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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. 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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.