Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi ,
I have a requirement whereby I need to select the 4 highest usage timings based on the last 6th and 7th day and provide a recommendation cleaning schedule. In my previous approach, it selected the 4 highest values and it could be timings neasrby(8AM,9,10,11AM) which should not how it be. It should be evenly distirbuted between 7AM -10PM. So now I need to rewrite the DAX .COuld anyone help.Thanks.I will explain below how I had done previously.
I have a measure to select the last 6th and 7th day
I have another measure to select the sum of the water consumption and filter for the last 6th and 7th day and also select only between 7 to 10 PM.
The next rank_measure is placed in the filter and selected <=4 to select 4 highest values.
and the correspoinding time and day is shown in the table.
So the above table is the final output. here it can be seen that the timings are close which does not fit the purpose as the cleaning schedulte recommendation should not be close..
thanks in advance if someone could help me on this matter.
Solved! Go to Solution.
Hi, @Learner_SG
You can try the following methods.
Column:
Column =
IF (
[Intervals] = BLANK (),
BLANK (),
IF (
[sum_wc_consumption]
= CALCULATE (
MAX ( measurement[sum_wc_consumption] ),
FILTER (
measurement,
[Intervals] = EARLIER ( measurement[Intervals] )
&& [weekday] = EARLIER ( measurement[weekday] )
)
),
[Time:]
)
)
Is this the result you expect? For each time period, choose a time that is used most frequently.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
Hi @lbendlin ,sorry for the screenshots alone. I have attached the sample data . this is the summarized table which I created from the original table and I need to select the highlighted values(time and day) which has to be shown in a table. This will serve as my recommendation table.
Thank you for providing the sample data. That helps a lot with proposing a potential solution.
Here is a graphical version using a heatmap:
That might be sufficient?
@lbendlin ,thanks. But what I need is the time and weekday to be selected and present it in a table. So the highest from each interval , 7-10 ,12-2,4-6 8-10pm 1 each should be selected and the corresponding time and day should be shown in my table. Hope my explanation is clear. Please let me know if you need further clarification.
Hi, @Learner_SG
You can try the following methods.
Column:
Column =
IF (
[Intervals] = BLANK (),
BLANK (),
IF (
[sum_wc_consumption]
= CALCULATE (
MAX ( measurement[sum_wc_consumption] ),
FILTER (
measurement,
[Intervals] = EARLIER ( measurement[Intervals] )
&& [weekday] = EARLIER ( measurement[weekday] )
)
),
[Time:]
)
)
Is this the result you expect? For each time period, choose a time that is used most frequently.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks @v-zhangti ,this is what I expected .But a minor issue that I am facing now when I used for expression is that it selects the blank value into the table as shown below. How can I exclude it out. I could not find a way to filter it out as It is a time value.
Hi, @Learner_SG
As in the example shown, you can leave the blank value unchecked.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
94 | |
88 | |
35 | |
32 |
User | Count |
---|---|
153 | |
101 | |
82 | |
63 | |
52 |