Forum Discussion
GlynMThomas
Resolver I
7 years agoSum By Name Then Get The Min Value
Hi Guys, How in power bi do I first sum my transactions by name to get the totals for each of my clients then get the min and max values? I want to dynamically work out the who has spent the ...
- 7 years ago
GlynMThomas you can use MINX and MAXX function
Min Value = MINX( VALUES( Table[Clients] ), [Your Sum Measure] ) Max Value = MAXX( VALUES( Table[Clients] ), [Your Sum Measure] )
v-yuta-msft
Community Support
7 years ago
So your requirement is to achieve the max and min values of a measure in your senario, right? You could create two measures using dax below:
Max Values =
MAXX (
ADDCOLUMNS (
SUMMARIZE (
FILTER ( 'Table', 'Table'[Date] IN VALUES ( 'Table'[Date] ) ),
'Table'[Client]
),
"Total Per Client", CALCULATE ( SUM ( 'Table'[Sales] ) )
),
[Total Per Client]
)
Min Values =
MINX (
ADDCOLUMNS (
SUMMARIZE (
FILTER ( 'Table', 'Table'[Date] IN VALUES ( 'Table'[Date] ) ),
'Table'[Client]
),
"Total Per Client", CALCULATE ( SUM ( 'Table'[Sales] ) )
),
[Total Per Client]
)
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.