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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
lookieuk
New Member

help with DAX SUMX

Hello!

I'm just starting out with DAX and Power BI. I've created a basic DAX measure where I calculate two columns after applying a filter on other columns.

My question is: Is there a way to use the result from the part cost measure and multiply it by another column value that has been filtered in the same way as the part cost measure?

 

my DAX code:

Parts Cost = CALCULATE(SUMX(FILTER(QuoteCostSheetLine,QuoteCostSheetLine[wb_ActivityCode] = "Parts"),QuoteCostSheetLine[Quantity] * QuoteCostSheetLine[wb_CostRate]))
1 ACCEPTED SOLUTION
v-xuxinyi-msft
Community Support
Community Support

Hi @lookieuk 

 

Thanks for the reply from lbendlin .

 

The following is a test I did using sample data for your reference.

vxuxinyimsft_0-1732785415644.png

 

Measure:

Result = 
VAR _M1 = CALCULATE(SUM(financials[Profit]), FILTER('financials', [Country] = "Canada"))
VAR _M2 = CALCULATE(SUM(financials[Sale Price]), FILTER('financials', [Country] = "Canada"))
RETURN
_M1 * _M2

 

Output:

vxuxinyimsft_1-1732785751164.png

 

If the problem still exists, then as Lindlin said, you need to provide sample data and expected results based on the sample data so that we can better help you. Please remove any sensitive data in advance.

 

Best Regards,
Yulia Xu

 

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

View solution in original post

2 REPLIES 2
v-xuxinyi-msft
Community Support
Community Support

Hi @lookieuk 

 

Thanks for the reply from lbendlin .

 

The following is a test I did using sample data for your reference.

vxuxinyimsft_0-1732785415644.png

 

Measure:

Result = 
VAR _M1 = CALCULATE(SUM(financials[Profit]), FILTER('financials', [Country] = "Canada"))
VAR _M2 = CALCULATE(SUM(financials[Sale Price]), FILTER('financials', [Country] = "Canada"))
RETURN
_M1 * _M2

 

Output:

vxuxinyimsft_1-1732785751164.png

 

If the problem still exists, then as Lindlin said, you need to provide sample data and expected results based on the sample data so that we can better help you. Please remove any sensitive data in advance.

 

Best Regards,
Yulia Xu

 

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

lbendlin
Super User
Super User

Yeah, that code looks a little adventurous.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information. Do not include anything that is unrelated to the issue or question.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.