The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I am trying to color the highest and lowest values by revenue in a chart. I've created measures for max values, min values and then measure for color.
Individually max and min values are working correctly, however when I use them in a color measure, they are giving wrong results.
Measure for Revenue
Measure for Max
Solved! Go to Solution.
Hi @Zeshansaif
While I can't fully explain the reason, I've noticed some peculiar behavior involving context filter sections when using a DAX-generated calendar. My recommendation is to either utilize a calendar table directly from the database or construct one using Power Query. Your formulas appear to be correct. Once I replaced your DAX calendar with my PQ-generated calendar, everything functioned flawlessly.
The updated pbix is attached
More information about date table power query include script is here :
https://radacad.com/create-a-date-dimension-in-power-bi-in-4-steps-step-1-calendar-columns
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi @Zeshansaif
Sorry, i didn't check the order of the days.
You can update the formula to :
The updated pbix is attached
Hi @Zeshansaif
Since you haven't attached the data file, I'll try to demonstrate the logic using a simple example of my own.
I created basic model like :
and this is a daily data:
The basic measure is :
The pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi, Thanks for Response.
I am sharing drive link of the file. Go to Calender Sheet, in the bar chart I want to highlight highest and lowest. for 2024 it's working but not for other years. I dont know whats the reason.
Thanks.
Power BI File
Hi @Zeshansaif
While I can't fully explain the reason, I've noticed some peculiar behavior involving context filter sections when using a DAX-generated calendar. My recommendation is to either utilize a calendar table directly from the database or construct one using Power Query. Your formulas appear to be correct. Once I replaced your DAX calendar with my PQ-generated calendar, everything functioned flawlessly.
The updated pbix is attached
More information about date table power query include script is here :
https://radacad.com/create-a-date-dimension-in-power-bi-in-4-steps-step-1-calendar-columns
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi, Thanks for response.
I found the reason, as soon as I sort the 'day name column' by column 'daynumber', this anomaly appears.
If you find the solution, please let me know. Thanks
Even in your screenshot the sorting is out of order.
Hi @Zeshansaif
Sorry, i didn't check the order of the days.
You can update the formula to :
The updated pbix is attached
Thankyou so much, you are super!!!
Happy to help 🙂
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
80 | |
78 | |
44 | |
39 |
User | Count |
---|---|
150 | |
116 | |
68 | |
64 | |
57 |