Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 38 | |
| 33 | |
| 19 | |
| 16 |
| User | Count |
|---|---|
| 68 | |
| 66 | |
| 41 | |
| 34 | |
| 24 |