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
Anonymous
Not applicable

Measure/ Column

Hi everyone,

 

I need your help in the following: 

 

I want to do another column /measure to have Opportunity X sum as 39486.96 and Opportunity Y sum as 60735.6, how can I achieve that? There are a lot of opportunities though not only X and Y.

 

Opportunity NameExpected Value CurrencyExpected Value

XUSD39486.96
XUSD39486.96
XUSD39486.96
XUSD39486.96
XUSD39486.96
XUSD39486.96
XUSD39486.96
YUSD60735.6
YUSD60735.6
YUSD60735.6
YUSD60735.6
YUSD60735.6
YUSD60735.6
YUSD60735.6

 

Thanks,

Amr

5 REPLIES 5
v-rongtiep-msft
Community Support
Community Support

Hi @Anonymous ,

 

First of all, I want to know if the data you gave is the original data.

If it did not the original data, I made an attempt with the following data.

 

1.PNG

Expected Value = CALCULATE(SUM('Table'[Value]),ALLEXCEPT('Table','Table'[Opportunity  ]))
Average =CALCULATE(AVERAGE('Table'[Value]),ALLEXCEPT('Table','Table'[Opportunity  ]))

 

2.PNG

If it's still not the result you want, please share the raw data with me and let me know about your thoughts.

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,
Community Support Team _ Polly

Greg_Deckler
Super User
Super User

@Anonymous If you need SUMIF, you can do it like:

SUMX(FILTER('Table',[Opportunity Name] = "X"),[Value])

Excel to DAX Translation - Microsoft Power BI Community


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Sergione
New Member

Hello @Anonymous,  it seems that you're looking for an equivalemnt of Excel's SUMIF. Am I right?

I believe you'll find an answer after carefully reading this article - How CALCULATE works in DAX - SQLBI. I'm convinced that it will help you a lot in the future, so it definitely worth to invest some time in understading this material.

Good luck with learning DAX! And let us know if you still have doubts after reading it 🙂

amitchandak
Super User
Super User

@Anonymous , Not very clear

if you have Expected Value

then a measure

sumx(summarize(Table, Table[Opportunity Name], Table[Expected Value] ), [Expected Value])

 

If not then new column 

Expected Value = if([Opportunity Name] = "X" , 39486.96,60735.6)

Anonymous
Not applicable

Thank you :)) , This one worked sumx(summarize(Table, Table[Opportunity Name], Table[Expected Value] ), [Expected Value]). The problem I couldnt calculate the average of this function.

 

Expected Value = if([Opportunity Name] = "X" , 39486.96,60735.6) --> this one assumes I only have to opportunity names, which is not the case.

 

I have multiple opportunity names, Expected Values. 

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.