Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Experts,
I have a requirement where we are using a matrix for showing data and need to build a button(Last 5 days date) and when we click on that it should show only the last 5 days' data in the matrix,
For particular requirements on how to build a measure, Need your input and suggestions
Thanks in advance,
Regards,
Hk
Solved! Go to Solution.
Hi @kousar99 ,
1-You can create a flag column. If gives 1 value (or the text "Last 5 days") to the records that are last 5 days (Today and 4 days before). Then you can put this column as a slicer which contains last 5 days.
2-In terms of measure, You can do this:
Last5DaysMEasure =
CALCULATE (
[YourMeasure],
FILTER (
ALL ( 'DateTable' ),
'DateTable'[Date]
>= TODAY () - 4
&& 'DateTable'[Date] <= TODAY ()
)
)
If this answer solves your problem, give it a thumbs up and mark it as an accepted solution so the others would find what they need easier.
Regards,
Loran
Hi @kousar99 ,
1-You can create a flag column. If gives 1 value (or the text "Last 5 days") to the records that are last 5 days (Today and 4 days before). Then you can put this column as a slicer which contains last 5 days.
2-In terms of measure, You can do this:
Last5DaysMEasure =
CALCULATE (
[YourMeasure],
FILTER (
ALL ( 'DateTable' ),
'DateTable'[Date]
>= TODAY () - 4
&& 'DateTable'[Date] <= TODAY ()
)
)
If this answer solves your problem, give it a thumbs up and mark it as an accepted solution so the others would find what they need easier.
Regards,
Loran
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |