Forum Discussion
Wresen
Post Patron
6 years agoGet highest value in Graph to use as line
Hi and thanks for reading this. I have a line and stacked column chart and i want to use the highest colum value to use in the line value I want it to be in a measure and the value for the line...
- 6 years ago
HI
I found a solution :
Measure 1:
Max2 = SUM('Table'[Value])Measure 2:Maxx = maxx(VALUES('Table'[Month]);[Max2])Measure 3 (modifid code that i got from v-lionel-msft )Max1 = CALCULATE( [Maxx]; ALLEXCEPT( 'Table'; 'Table'[Item] ); ALL('Table'[Month]))
v-lionel-msft
Community Support
6 years agoHi Wresen ,
Try this:
Max1 =
CALCULATE(
SUM('Table'[Value]),
ALLEXCEPT(
'Table',
'Table'[Item]
),
ALL('Table'[Month])
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Wresen
Post Patron
6 years ago
thanks so much ,but is it possible to get the highest value for the months , now it takes the total sum for all months.
So for Lamp A its will be 23 , and Lamp B 14
/Thanks
- v-lionel-msft6 years ago
Community Support
Hi Wresen ,
Yes, you can.
1. Add a custom column
2.Split [month] column into [Year] column and [Month] column
3. Create two measure separately
Measure_sum = CALCULATE( SUM('Table'[Value]), ALLEXCEPT( 'Table', 'Table'[Item], 'Table'[Month] ) )Measure_max = CALCULATE( MAXX( 'Table', [Measure_sum] ), ALL('Table'[Custom]) )Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Wresen6 years ago
Post Patron
HI
I found a solution :
Measure 1:
Max2 = SUM('Table'[Value])Measure 2:Maxx = maxx(VALUES('Table'[Month]);[Max2])Measure 3 (modifid code that i got from v-lionel-msft )Max1 = CALCULATE( [Maxx]; ALLEXCEPT( 'Table'; 'Table'[Item] ); ALL('Table'[Month]))