Forum Discussion
ManaT
1 year agoFrequent Visitor
Dim Customer when used to filter gives wrong values
I have a dashboard with multiple dims and facts. I am trying to use Dim Customer [Customer] field to filter the FactMargin table. There is a relationship 1-* between the two. Now when I try to use Gr...
- 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
Ashish_Mathur
Super User
1 year agoHi,
Share the download link of the PBI file. Show the problem and expected result there.
ManaT
1 year agoFrequent Visitor
I am unable to provide a pbix as this is a confidential data for a client. Recreating it would be hard as well as it might not capture the whole issue.