Forum Discussion
NoSayMe
4 years agoRegular Visitor
Data Model - switch relation from inactive to active by filter.
Hi, looking for help with the following ... I got 2 tables: Customers: Spending: Filter: Filter Measures: Data Model: Report: I ...
- 4 years ago
Hi NoSayMe ,
Sorry I can't access your sample file. According to your description, I create a sample. I add some data in the Spending table like below.
You want to show the seperate amount differentiate by own paid or friends paid for each customer.
Here's my solution, modify the measure.
Own money = CALCULATE ( SUM ( 'Spending'[Amount] ), 'Spending'[UsedOwnMoney] = TRUE, USERELATIONSHIP ( 'Spending'[CustomerID], 'Customers'[Customers_ID] ) )Friends money = CALCULATE ( SUM ( 'Spending'[Amount] ), 'Spending'[UsedOwnMoney] = FALSE, USERELATIONSHIP ( 'Spending'[CustomerID], 'Customers'[Customers_ID] ) )Get the result.
Then if you want to ignore the who paid switch and calculate the sum amount, create a measure.
Measure = CALCULATE ( SUM ( Spending[Amount] ), USERELATIONSHIP ( Spending[CustomerID], 'Customers'[Customers_ID] ) )Get the result.
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lbendlin
4 years agoSuper User
Read about using Field Parameters. They also work with measures and can simplify what you are trying to achieve.