Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello ,
I have issues with Userelationship function.
In fact I have two measures :
Total_Amount_Direct =
CALCULATE (
SUM (Fact1[money] );
DATESYTD( 'Date_Table'[Date] );
FILTER ( Dimension; Dimension[Filter_Column] = "Physical")
)
Total_Amount_UserRelationShip =
CALCULATE (
SUM (Fact2[Amount] );
DATESYTD( 'Date_Table'[Date] );
FILTER ( Dimension; Dimension[Filter_Column] = "Physical");
USERELATIONSHIP ( Fact2[ID]; Fact1[ID] )
)
This is the result :
When I add the Filter Column to the table everything come wrong?
Is this the effect of the USERELATIONSHIP Function?
I need to add new Dimension ( copy of the existing Dimensio) to filter the table and have the good result?
Solved! Go to Solution.
Difficult to say what the problem is with the information provided. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Hello Greg,
This is my Schema :
I think when we want to across the dimension column returned from the USERELATIONSHIP then I cant see nothing as result
I think it's a DAX Logic
@Anonymous @Greg_Deckler
The relation betwee my Fact tables is 1..1
In fact I solve it but it looks strange :
I have 3 measures :
Total_Amount =
CALCULATE (
SUM ( 'Fact1'[Amount] );
DATESYTD ( 'Date'[Date] );
FILTER (Dimension; LEFT ( Dimension[Filter_Column]; 1 ) <> "5")
)
Total_Amount1 =
CALCULATE (
SUM ( 'Fact'[Amount] );
DATESYTD ( 'Date'[Date] );
FILTER (Dimension; LEFT ( Dimension[Filter_Column]; 1 ) <> "5");
USERELATIONSHIP ( 'Fact1'[ID]; 'Fact2'[ID] )
)
Total_Amount2 =
CALCULATE (
SUM ( 'Fact'[Amount] );
DATESYTD ( 'Date'[Date] );
CALCULATETABLE (
SUMMARIZE (
Dimension;
Dimension[Dim_ID];
Dimension[Filter_Column]
);
FILTER ( Dimension; LEFT ( Dimension[Filter_Column]; 1 ) <> "5" )
);
USERELATIONSHIP ( 'Fact1'[ID]; 'Fact2'[ID] )
)
Relation between Fact1 and Fact2
1..*
Relation between Fact1 and Dimension
*..1
Column 1 and Column 2 are from Fact1 Table
There is no relation betwenn Fact 2 and Dimension .
There is no relation between Fact2 and Column 1 and Column 2 (we need to use the USERELATIONSHIP )
Result as follows:
The result is ok for the third measure using the CalculateTable, but I didn't Understand why the second Measure did not work !
Can Someone explain to me?
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
11 | |
9 | |
6 |