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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
GuiBrum
Frequent Visitor

Measure with wrong total using multiple filters

Hello Community, I am so excited about learning PowerBi, thank you all for the support.

 

The measure is calculating price effect for sales rep, customer and product.

(TY price - LY price) * LY quantity for each row.

The total is not correct, upon research I found that I could Use SUMMARIZE and IF ( HASNOVALUE functions for one of the criterias and the sum is correct if I was only using the one criteria, but I am not being able to have the summarize table with all 3 criterias above.

This is as far as I got now (summarizing by product). Thanks for the help

 

 

 

Price Effect Measure =
VAR PriceEffect = CALCULATE( ( 'Sales Measures'[Sales Price] - [Sales Price LY] ) * [Sales Quantity LY] )
VAR TPriceEffect = SUMMARIZE( 'Product List', 'Product List'[Product], "TPriceEffect", CALCULATE( ( 'Sales Measures'[Sales Price] - [Sales Price LY] ) * [Sales Quantity LY] ) )

Return
IF( HASONEVALUE( 'Product List'[Product] ),
PriceEffect,
SUMX( TPriceEffect, [TPriceEffect] ) )

 

 

 

 

3 REPLIES 3
v-zhenbw-msft
Community Support
Community Support

Hi @GuiBrum ,

 

How about the result after you follow the suggestions mentioned in my original post?
Could you please provide more details or expected result about it If it doesn't meet your requirement?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-zhenbw-msft
Community Support
Community Support

Hi @GuiBrum ,

 

You can refer to this pbix file for the question about total incorrect.

 

PBIX as attached.

 

Measure 1.jpg

 

If it doesn’t meet your requirement, could you please provide a mockup sample  based on fake data or describe the fields of each tables and the relations between tables simply?

 

It will be helpful if you can show us the exact expected result based on the tables.

 

Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.     

 

Best regards,

 

Community Support Team _ zhenbw

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 @GuiBrum ,

 

Be aware that when using this type of calculation you need to pick the value from the lowest level so if you have for example Customer, Family and Product on your table you need to do the hasonevalue on the product level.

 

Is the Product the smallest level of your summarization or do you have additional columns wiht lower granularity?

 

Can you share a sample file?


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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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