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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Jonas_Holm
Helper I
Helper I

Sales price via direct query shows incorrect total / subtotal

Hello,

 

I have this problem, that whenever I try to calculate sales, it doesn't show the correct total sales.

 

Jonas_Holm_0-1667489253654.png

Jonas_Holm_1-1667489272993.png

Jonas_Holm_3-1667489673208.png

 

Below is what the expected result should have been like:

 

Jonas_Holm_4-1667489798763.png

under names I have these items:

Jonas_Holm_0-1667489953651.png

name = haircare and perfumes

order_id = 2005114916 and 2005114915

product_id = 76039, 87848 etc.

 

Can anyone help?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Jonas_Holm ,

 

You could first create a measure like

Measure = IF(ISINSCOPE('Table'[product_id]),SUM('Table'[base_price_ex_tax])*[Qty Measure])

vstephenmsft_0-1667549020125.png

Then create another measure to sum up.

Sales = SUMX('Table',[Measure])

vstephenmsft_1-1667549054456.png

 

Best Regards,

Stephen Tao

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @Jonas_Holm ,

 

You could first create a measure like

Measure = IF(ISINSCOPE('Table'[product_id]),SUM('Table'[base_price_ex_tax])*[Qty Measure])

vstephenmsft_0-1667549020125.png

Then create another measure to sum up.

Sales = SUMX('Table',[Measure])

vstephenmsft_1-1667549054456.png

 

Best Regards,

Stephen Tao

 

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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