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
I have a report which has data uploaded daily up to month to date prior (for example: if today is Dec 20, 2022, I have data from Dec 1 to 19, 2022). Currently we are utilizing 'Filters on all pages' to filter the 'Month Year' to a 'relative date is this month'. This works fine for all days until Jan 1, 2023...
How can I ensure that the report will show Dec 1 to 31, 2022 when the calendar date is Jan 1, 2023?
Thank you for your help!
Solved! Go to Solution.
Hi @SparkDataGuru ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Flag =
var _today=TODAY()
return
SWITCH(
TRUE(),
_today=DATE(YEAR(_today),MONTH(_today),1)&&
MAX('Table'[Date]) >=DATE(YEAR(_today),MONTH(_today)-1,DAY(_today))&&
MAX('Table'[Date]) <_today,1,
_today<>DATE(YEAR(_today),MONTH(_today),1)&&
MAX('Table'[Date]) >=DATE(YEAR(_today),MONTH(_today),1)&&MAX('Table'[Date])<_today,1,0)
2. Place [Flag]in Filters, set is=1, apply filter.
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @SparkDataGuru ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Flag =
var _today=TODAY()
return
SWITCH(
TRUE(),
_today=DATE(YEAR(_today),MONTH(_today),1)&&
MAX('Table'[Date]) >=DATE(YEAR(_today),MONTH(_today)-1,DAY(_today))&&
MAX('Table'[Date]) <_today,1,
_today<>DATE(YEAR(_today),MONTH(_today),1)&&
MAX('Table'[Date]) >=DATE(YEAR(_today),MONTH(_today),1)&&MAX('Table'[Date])<_today,1,0)
2. Place [Flag]in Filters, set is=1, apply filter.
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
I believe you will find the answer in the following topic.
https://community.powerbi.com/t5/Desktop/Relative-Date-Filtering-Based-On-Yesterday/m-p/728896
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 86 | |
| 85 | |
| 68 | |
| 64 |