Forum Discussion
Power BI DAX
- 4 years ago
Hi Learner_SG ,
I got it. Here's my solution.
1.Create a check measure.
Check = IF(MAX('Sheet4'[Parsed_Date])=TODAY()-7,1)Put the measure in the visual filter and let the value is 1.
2. Create a rank measure.
Rank = RANKX ( FILTER ( ALL ( 'Sheet4' ), 'Sheet4'[Parsed_Date] = TODAY () - 7 ), CALCULATE ( SUM ( 'Sheet4'[WC Water Consumption(mL)] ) ), , DESC, DENSE )Put the measure in the visual filter and let the value <=4, get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Learner_SG ,
do you mean display the 4 highest times in the last 7 days? If this is the case, here's my solution.
1.Create a date table.
Date = CALENDAR(DATE(2022,1,1),TODAY())
2.Make relationship between the two tables, note the Parsed date should be Date type.
3.Put the date column in a slicer, select Relative Date>Last 7 Days.
4.In the visual filter, put WC Water Consumption in the box below "By value", and select Top 4.
It will always get the top 4 values in the last 7 days.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Learner_SG4 years agoHelper IV
Hi v-yanjiang-msft , thanks for the detailed explanation and solution. In fact my requirement is that , I need to display in the table , previous 7th day data. that means, if i display the dashboard today(friday), it should show me the last friday's 4 highest time when the usage+occupancy is high and it will change each day. Hope its clear now. Sorry,if my earlier phrasing of the sentence caused confusion. Could you guide me on this?
- v-yanjiang-msft4 years agoCommunity Support
Hi Learner_SG ,
I got it. Here's my solution.
1.Create a check measure.
Check = IF(MAX('Sheet4'[Parsed_Date])=TODAY()-7,1)Put the measure in the visual filter and let the value is 1.
2. Create a rank measure.
Rank = RANKX ( FILTER ( ALL ( 'Sheet4' ), 'Sheet4'[Parsed_Date] = TODAY () - 7 ), CALCULATE ( SUM ( 'Sheet4'[WC Water Consumption(mL)] ) ), , DESC, DENSE )Put the measure in the visual filter and let the value <=4, get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Learner_SG4 years agoHelper IV
v-yanjiang-msft , Thanks a lot. I did a quick check,it works,