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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!