Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
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 |
---|---|
10 | |
9 | |
8 | |
8 | |
8 |
User | Count |
---|---|
13 | |
12 | |
11 | |
10 | |
8 |