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

Sum Column with two conditions

Hello all,

I would like to calculate the sum of the respective plants via the customer in PowerBI. (Plant A1 => Customer 2 = 250)

Unfortunately, I am still quite new to PowerBI and need help, as I don't know how to do it. The SumX formula did not work for me, so I am quite confused how i can calculate a something like a sumif with two conditions in PowerBI.


Thank you very much for your help.

 

sandro1995_0-1666172723422.png

 

Best Regards
Sandro

 

1 ACCEPTED SOLUTION

@Anonymous Well, you could create a calculated table like:

Table = SUMMARIZE('Table',[Plant],[Customer],"Sales",SUM('Table'[Sales]))

 


@ 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...

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@Greg_Deckler 

 

Thank you for your fast response/help. 

 

The suggestion worked. But Is there a possibility to get the resulting values in a seperate row? As I want to use the resulting values in a Slicer for numeric ranges?

 

For example I just want to see customers which sales are higher than 300 in the visualization.

 

Thank you!

 

Kind regards

Sandro

@Anonymous Well, you could create a calculated table like:

Table = SUMMARIZE('Table',[Plant],[Customer],"Sales",SUM('Table'[Sales]))

 


@ 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...
Greg_Deckler
Super User
Super User

@Anonymous Try:

Column = 
  VAR __Plant = [Plant]
  VAR __Customer = [Customer]
RETURN
  SUMX(FILTER('Table', [Plant] = __Plant && [Customer] = __Customer),[Sales])


Measure =
  VAR __Plant = MAX([Plant])
  VAR __Customer = MAX([Customer])
RETURN
  SUMX(FILTER('Table', [Plant] = __Plant && [Customer] = __Customer),[Sales])

@ 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...

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.

Top Solution Authors