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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors