The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Probably a really easy question but I can't seem to figure it out.
My data source looks like this.
TABLE1
ID | SITE | CUSTOMER | ITEM | SPEND |
1 | 1 | A | item1 | 10 |
... | ... | ... | ... | ... |
I've made a visual in my report that looks like this:
CUSTOMER | SUM OF SPEND |
A | 40 |
B | 20 |
C | 100 |
D | 50 |
E | 220 |
I am trying to write a measure that returns the maximum spend based overall customers. So I want my output to be this.
CUSTOMER | SUM OF SPEND | MAX SPEND |
A | 40 | 220 |
B | 20 | 220 |
C | 100 | 220 |
D | 50 | 220 |
E | 220 | 220 |
I tried to do CALCULATE(MAX('TABLE1'[SPEND]), ALLSELECTED('TABLE1')) but this returns the highest spend line from TABLE1 not the highest sum of spend line from the visual like I want.
Anyone able to help me please?
Thank you.
Solved! Go to Solution.
Hi @Anonymous ,
Try this:
Measure = MAXX( SUMMARIZE( ALLSELECTED(Table1) , Table1[Customer] , "Value" , SUM(Table[Spend]) ) [Value] )
Hi @Anonymous ,
Try this:
Measure = MAXX( SUMMARIZE( ALLSELECTED(Table1) , Table1[Customer] , "Value" , SUM(Table[Spend]) ) [Value] )
Worked perfectly thank you. I forgot the SUMMARIZE function.
User | Count |
---|---|
80 | |
78 | |
37 | |
34 | |
31 |
User | Count |
---|---|
93 | |
81 | |
60 | |
49 | |
49 |