Forum Discussion
Sam_2020
6 years agoHelper I
Measure
How to write measure of the column header with Sales > 60 and the total value is 100? Product Sales Sales > 60 A 100 100 B 30 C 50 Total 180 100
nandic
6 years agoResident Rockstar
Hi Sam_2020 ,
If purpose is to display only max value and to display same value in total, below is formula:
Max Value = IF(MAX(Sheet1[Sales]) = CALCULATE(MAX(Sheet1[Sales]),ALL(Sheet1[Product])),MAX(Sheet1[Sales]))
Cheers,
Nemanja
Sam_2020
6 years agoHelper I
Thanks Namaja for your reply.
If I have other product which are >60, then how should i write the measure?
| Product | Sales | Sales > 60 |
| A | 100 | 100 |
| B | 30 | |
| C | 50 | |
| D | 75 | 75 |
| E | 90 | 90 |
| Total | 345 | 265 |
- ryan_mayu6 years agoSuper User
for the second scenario,
please try this
Measure = VAR _value=SELECTEDVALUE('Table'[SALES]) return IF(_value>100,_value,SUMX(FILTER('Table','Table'[SALES]>60),'Table'[SALES]))- Sam_20206 years agoHelper I
Thanks.
It works perfectly.
Are you able to explain "return IF(_value>100;_value;"?
Do I need to look the highest value and indicate in my measure?
- ryan_mayu6 years agoSuper User
No need to look the highest value. I didn't use Max function.
_value is to select the value(please see VAR function), if >100, then select and display
https://docs.microsoft.com/en-us/dax/var-dax