Forum Discussion
Cumulative Heat Map
I'm trying to make a heat map of counting locations visited in racks, but what I need is for the color to be by the cumulative.
Example: I have a column about how many times those locations have been visited, from there I would take a percentage from the total, it is ordered from highest to lowest, everything will turn red until the cumulative reaches 30%, yellow when the cumulative is from 30% to 80% and green when the cumulative is 80% to 100%, That would be my logic, but I can't see how to do it in Power BI, with the conditional formatting it has.
Right now it's for the Maximum, and not for the accumulated, someone could help me, thank you.
16 Replies
- amitchandakSuper User
Syndicate_Admin , You can use the same logic in measure to return column and use in conditional formatting using field value option
Power BI ABC Analysis using Window function, Dynamic Segmentation: https://youtu.be/A8mQND2xSR4
How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/1682539 - lbendlinSuper User
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 - Syndicate_AdminAdministrator
This would be the data: Regarding locations and QTY Mov, perform the cumulative and from that cumulative make the logic that I explained above:
Location Vin. QTY Mov. Zone 104-058-01 1 41 3 Attracted 105-049-01 1 30 3 Attracted 110-039-01 1 30 2 Medium 106-021-01 1 28 1 Forward 104-054-01 1 24 3 Attracted 108-049-01 1 24 3 Attracted 109-007-01 1 23 1 Forward 105-048-01 1 22 3 Attracted 117-053-01 1 22 3 Attracted 104-012-01 1 21 1 Forward 106-049-01 1 21 3 Attracted 110-045-01 1 21 3 Attracted 114-050-01 1 21 3 Attracted 103-041-01 1 20 2 Medium 112-050-01 1 20 3 Attracted 105-063-01 1 19 3 Attracted 104-053-01 1 18 3 Attracted 105-002-01 1 18 1 Forward 105-050-01 1 18 3 Attracted 108-044-01 1 18 3 Attracted 109-002-01 1 18 1 Forward 115-022-01 1 18 1 Forward 116-034-01 1 18 2 Medium 103-023-01 1 17 2 Medium 106-048-01 1 17 3 Attracted 103-022-01 1 16 1 Forward 103-024-01 1 16 2 Medium 104-015-01 1 16 1 Forward 104-019-01 1 16 1 Forward 108-041-01 1 16 2 Medium 109-057-01 1 16 3 Attracted 114-007-01 1 16 1 Forward 114-010-01 1 16 1 Forward 115-006-01 1 16 1 Forward 103-053-01 1 15 3 Attracted 104-051-01 1 15 3 Attracted 105-003-01 1 15 1 Forward 108-022-01 1 15 1 Forward 109-051-01 1 15 3 Attracted 117-041-01 1 15 2 Medium 117-048-01 1 15 3 Attracted 103-018-01 1 14 1 Forward 103-053-04 4 14 3 Attracted 104-013-01 1 14 1 Forward 104-014-01 1 14 1 Forward 105-038-01 1 14 2 Medium 108-024-01 1 14 2 Medium 113-013-01 1 14 1 Forward 114-045-01 1 14 3 Attracted Thank you very much, sorry for the delay
- lbendlinSuper User
To confirm, you want them sorted by Qty Mov. descending?
- Syndicate_AdminAdministrator
By ascending please, that is, the logic that is ordered by ascending, and that the first data that reaches 30% of the accumulated color is colored red, from 30% to 80% of the accumulated color yellow and from 80% to 100% of green color, I don't know if you explain me well, thank you
- lbendlinSuper User
so the opposite of how your sample data is sorted?
- Syndicate_AdminAdministrator
Finger error, if by Descending as the sample data is sorted, sorry
- lbendlinSuper User
what do you want to do in case of ties? Do you want to use the location as a secondary sort column or do you want to use small random values to break the tie?
- Syndicate_AdminAdministrator
If it's okay to sort by location as secondary, thank you
- Syndicate_AdminAdministrator
Good afternoon, inform him to try to replicate it, but I get 100% everything (marked green).
And if I filter by month or a client, it still stays with the same result and doesn't change (highlighted with orange)
Should something be done differently in the code?
- lbendlinSuper User
Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.
- Syndicate_AdminAdministrator
This would be with a filter per month, it would change the cumulative.
and if I filter by another field (Zone):
The cumulative percentage remains unchanged from the general
- Syndicate_AdminAdministrator
Could you understand the explanation I gave you, or do you want to have a meeting, to explain better?
- lbendlinSuper User
I think that's all I could contribute. Maybe someone else can chime in.