Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Sam_2020
Helper I
Helper I

Measure

How to write measure of the column header with Sales > 60 and the total value is 100?

 

ProductSalesSales > 60
A100100
B30 
C50 
Total180100
1 ACCEPTED SOLUTION

@Sam_2020 

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]))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

11 REPLIES 11
nandic
Super User
Super User

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]))
 
Max Sales in total and max row.PNG

Cheers,
Nemanja

Thanks Namaja for your reply.

 

If I have other product which are >60, then how should i write the measure?

 

Product SalesSales > 60
A100100
B30 
C50 
D7575
E9090
Total345265

@Sam_2020 

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]))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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?

 

 

@Sam_2020 

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

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@Sam_2020 

Please try this

Measure = IF(SELECTEDVALUE('Table'[SALES])=100,100,SUMX(FILTER('Table','Table'[SALES]=100),'Table'[SALES]))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hello Nemanja,  thanks for the response. I am not looking for the MAX value. What I am looking for is creation of a measure by the simple clicking on any bar - that becomes my selected category. If I get that category name as a new measure, I want to create another chart detailing the sales trend of that category over a period of time. Maybe this is wishful thinking - the experts can give their opinion.

kkanda

Hello All,

My question was diffrent and I do not know how it got clubbed with another query. 

This question is still open and there is no accepted solution. 

Will you please remove the "ACCEPTED SOLUTION" from my original post, so that others will look at it?

Thanks

kkanda

 

@kkanda 

Please share your post link or create a new post

.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




This question was answered by Nemanja.

Thanks for all responses.

Hi @kkanda ,

By mistake i tagged you on this question.
I also now answered on your question 🙂

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.