Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello community, I'm looking for support in a Day over Day comparison based on selections from date slicers.
I have a table with Date and ID, similar to this:
Date | ID |
Jan 3 | ABC001 |
Jan 3 | ABC002 |
Jan 3 | ABC003 |
Jan 2 | ABC001 |
Jan 2 | ABC002 |
Jan 1 | ABC001 |
Jan 1 | ABC002 |
Then I have two Date slicers:
In other words, if Date slicer 1 = Jan 3 and Date slicer 2 = Jan 2, the table should show the following:
Date | ID | Flag |
Jan 3 | ABC001 | Yes |
Jan 3 | ABC002 | Yes |
Jan 3 | ABC003 | No |
I used the following Calculated Column to get the Flag, but as you can see it's working only with hard coded condition (Date = Date-1), rather than having the Date = SELECTEDVALUE from Date slicer 2:
Solved! Go to Solution.
Hi @ragnezza
You can try the following measure:
Flag =
VAR SelectedDate1 =
SELECTEDVALUE ( 'Slicer1'[Date] )
VAR SelectedDate2 =
SELECTEDVALUE ( 'Slicer2'[Date] )
RETURN
IF (
MAX ( [Date] ) = SELECTEDVALUE ( Slicer1[Date] ),
IF (
CALCULATE (
COUNTROWS ( 'Table' ),
'Table'[ID] = MAX ( [ID] ),
'Table'[Date] = SelectedDate2
) > 0,
"Yes",
"No"
),
BLANK ()
)
Output:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks a lot @Anonymous this worked!
Hi @ragnezza
You can try the following measure:
Flag =
VAR SelectedDate1 =
SELECTEDVALUE ( 'Slicer1'[Date] )
VAR SelectedDate2 =
SELECTEDVALUE ( 'Slicer2'[Date] )
RETURN
IF (
MAX ( [Date] ) = SELECTEDVALUE ( Slicer1[Date] ),
IF (
CALCULATE (
COUNTROWS ( 'Table' ),
'Table'[ID] = MAX ( [ID] ),
'Table'[Date] = SelectedDate2
) > 0,
"Yes",
"No"
),
BLANK ()
)
Output:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |