Forum Discussion
DAX Conditional Formatting the maximum value for each column in a Matrix
- 4 years ago
Read about the difference between aggregators (SUM, MAX) and iterators (SUMX, MAXX). That will help you to decide when to apply which (very roughly aggregators work on columns while iterators work on rows).
Let me know when you have sorted your actual requirement out. The measure I provided is only one of many possible implementations (and a very simplistic one, too). It did work for your original request, but it's perfectly fine for requirements to change during prototyping.
After a little more digging, it seems like it would work if I could SUM the GP total for each EAM by GROUP.
I expanded the table more below and did not realize that each INVOICE has a unique GP, sometimes on the same date and sometimes not.
I believe the measure is grabbing the first max value and not the SUM of each EAM?
Thank you for any thoughts, I looked and it seems MAXX allows for SUM but MAX does not, I could not even call a SUM Measure with MAX, needs to be a column.
| DATE | INVOICE | EAM | REVENUE | GP | GROUP |
| 12/15/2021 | 10006009 | Dale | $275 | $44 | ☁️ Cloud |
| 12/15/2021 | 10006010 | Harry | $40,299 | $3,929 | ☁️ Cloud |
| 12/15/2021 | 10006011 | Harry | $51,556 | $5,402 | ☁️ Cloud |
| 12/15/2021 | 10006012 | Karl | $34,048 | $5,059 | ☁️ Cloud |
| 12/15/2021 | 10006013 | Kathy | $6,514 | $850 | ☁️ Cloud |
Read about the difference between aggregators (SUM, MAX) and iterators (SUMX, MAXX). That will help you to decide when to apply which (very roughly aggregators work on columns while iterators work on rows).
Let me know when you have sorted your actual requirement out. The measure I provided is only one of many possible implementations (and a very simplistic one, too). It did work for your original request, but it's perfectly fine for requirements to change during prototyping.
- sscanlon4 years ago
Helper II
I ended up using using a Reference of original SAP-DIRECT Table, then filtered down dates I wanted and used "Group By" in Power Query Editor, once I did that for EAM and GROUP, then I could Sum new columns by REVENUE and GP and that gave me the exact table I wanted.
From there your measure worked great. I could not figure out how to use MAX Aggregate with SUM of REV / GP, read everything I could find and my brain could not do it.
Anyway thank you for the guidance, it worked in the end!