Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi everyone,
I have a code that uses the D-1 feature (or picks the selected date by the user), both commented here and it works perfectly when I use it in a table or visualization with the date explicitly added. However, what I need is to return the value (date) that meets this criteria to use it as a filter in multiple measures. How can I do this?
Please find here the PBIX file with test data and the "check_right_with_explicit_date" measure is the one that works with the dates added.
Thanks
Hi @julsr - you need to create a measure or calculated column that dynamically determines the date. Then, you can use this dynamic date as a filter context for other calculations.
create a ameasure
SelectedDate =
VAR MaxDate = MAX('DateTable'[Date]) // Adjust this to match your logic
RETURN
IF(
MaxDate = TODAY() - 1, // Replace with your D-1 logic
MaxDate,
BLANK()
)
Once you have the measure, you can use it as part of your filter logic in other measures.
FilteredMeasure =
CALCULATE(
SUM('FactTable'[Value]),
FILTER(
'DateTable',
'DateTable'[Date] = [SelectedDate]
)
)
If your SelectedDate measure is returning a scalar value (like a specific date), you can directly apply it as a filter condition in your visualizations.
Proud to be a Super User! | |
Hi everyone! Any help on this would be appreciated. Thank you!
Thanks for your answer. That's exactly what I've done in my PBIX which I attached in the thread. The problem is that the formula is not returning a value that I can use in another measure. For example, what I want/need is to return the DayMinus1 or SelectedDate (the value itself) and then use this result in another measure as a filter, but it's not working and I don't know what's wrong.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 46 |