Forum Discussion
Dim Customer when used to filter gives wrong values
- 1 year ago
ManaT Hey,
I will below steps to troubleshoot my issue.your issue is related to the filtering context in Power BI and how the relationships between tables are affecting calculations:
- Ensure that the 1-* relationship between Dim Customer and FactMargin is correctly setup and active. The filtering should propagate correctly across this relationship.
- The measure you used:
I will use this below daxCM =
VAR CustIDs = VALUES( 'Dim Customer'[Customer] )
RETURN
CALCULATE(
[Contribution Margin],
REMOVEFILTERS('Dim Customer'),
TREATAS(CustIDs, 'FactMargin'[customer] ))
- I will reassess native measures used for Gross and Contribution Margin without REMOVEFILTERS and TREATAS to understand how context is being applied incorrectly.
- I will also confirm that slicers are setting the context as expected without additional or hidden filter effects influencing results.
Thanks
Harish M
Kindly give Kudos and accept it as solution if its solves your problem
Hi ManaT ,
Thank you for reaching out to the Microsoft Community Forum.
Hi MohamedFowzan1 , Ashish_Mathur , Shahid12523 , HarishKM , Thank you for your prompt responses.
Hi ManaT , Could you please try the proposed solutions shared by Shahid12523 and HarishKM . Please do let us know if you have any further queries.
Regards,
Dinesh
- v-dineshya1 year ago
Community Support
Hi ManaT ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.
Regards,
Dinesh
- v-dineshya1 year ago
Community Support
Hi @ManaT ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.
Regards,
Dinesh
- v-dineshya1 year ago
Community Support
Hi @ManaT ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.
Regards,
Dinesh