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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Memorable Member
Memorable Member

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.

nandic
Memorable Member
Memorable Member

Hi @kkanda ,

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.