Hi sir,I have today count measure Yesterday count measure Last week same day count measure How can we show today vs yesterday Today vs yesterday vs last week same day Today vs last week same day I'n line chart I tried to create switch measure But it accepts one value to one measure Any inputs on this pls
top of page
bottom of page
To visualize the comparisons between today, yesterday, and last week's same day counts, you can use a combination of measures and line charts in Power BI. Here's how you can do that:
1. Create Comparison Measures
You can create new measures to calculate the differences between the counts:
Today vs Yesterday:
Today vs Yesterday = [Today Count] - [Yesterday Count]
Today vs Last Week Same Day:
Today vs Last Week Same Day = [Today Count] - [Last Week Same Day Count]
2. Create a Line Chart for Each Comparison
For each comparison, create a line chart:
Today vs Yesterday Line Chart:
Axis: Date
Values: [Today Count], [Yesterday Count], [Today vs Yesterday]
Today vs Yesterday vs Last Week Same Day Line Chart:
Axis: Date
Values: [Today Count], [Yesterday Count], [Last Week Same Day Count]
Today vs Last Week Same Day Line Chart:
Axis: Date
Values: [Today Count], [Last Week Same Day Count], [Today vs Last Week Same Day]
3. Optional: Create a Switch Measure for Interactive Comparison
If you want to create an interactive comparison, you can create a switch measure that allows users to select which comparison they want to see. Here's an example of how to create a switch measure:
Comparison Measure =
SWITCH(
SELECTEDVALUE('Comparison'[Comparison Type]),
"Today vs Yesterday", [Today vs Yesterday],
"Today vs Last Week Same Day", [Today vs Last Week Same Day],
"Today vs Yesterday vs Last Week Same Day", [Today Count] - [Yesterday Count] - [Last Week Same Day Count],
BLANK()
)
In this example, 'Comparison' is a table containing a single column 'Comparison Type' with the values "Today vs Yesterday", "Today vs Last Week Same Day", and "Today vs Yesterday vs Last Week Same Day". The 'Comparison Measure' will calculate the selected comparison based on the user's selection.
You can then create a line chart with the 'Comparison Measure' as the value and provide a slicer or dropdown for users to select the comparison type.