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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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
v-stephen-msft
Community Support
Community Support

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
v-stephen-msft
Community Support
Community Support

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

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

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Kudoed Authors