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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Alexbienvenue
Frequent Visitor

How do I get this subtotal to display correctly

Power bi .jpg

As you can see, the total displayed is incorreect based on the dax measure Ive written for it. 

 

Just to note about my sitatuion here - I needed to use ALLEXCEPT because i need the TEST column to display those numbers independent of SKU column context...If i remove the ALLEXCEPT part it will take away some of the "juice" components of each SKU because not each SKU has a "Press" action as defined by my Wine Proccesing [Action] = "Press" column...any ideas? 

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @Alexbienvenue ,

You can create another new measure as below and put this new measure to replace the original measure [test]...

Measure =
SUMX (
    GROUPBY ( 'Wine Processing', 'Wine Processing'[SKU], 'Wine Processing'[Juice] ),
    [test]
)

In addition, you can refer the following links to try to solve your problem...

Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

Dax for Power BI: Fixing Incorrect Measure Totals

Best Regards

Community Support Team _ Rena
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

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @Alexbienvenue ,

You can create another new measure as below and put this new measure to replace the original measure [test]...

Measure =
SUMX (
    GROUPBY ( 'Wine Processing', 'Wine Processing'[SKU], 'Wine Processing'[Juice] ),
    [test]
)

In addition, you can refer the following links to try to solve your problem...

Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

Dax for Power BI: Fixing Incorrect Measure Totals

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MFelix
Super User
Super User

Hi @Alexbienvenue ,

 

You issue is a question of context on the totals the calculation is based on the overall table so you your calculation based on all the line that corresponde to that value.

 

Try the following code:

 

test =
var PressGallonsTEST = ....

Return
SUMX(ALLSELECTED('Wine Processing'[SKU]), PressGallonsTEST)

 

Be aware that this may need some adjustments.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors