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.
Have to use filter on userelationship?
@Analitika , You do nor need them when you use use reltion
CALCULATE(
sum('Table1'[DebtSumNacCurrency]),
USERELATIONSHIP('Table2'[SkOperacNo],'Table1'[OPERACNO])
)
It duplicates values wrong
but must return only one value where SkOperacNo = 64477
You need to remove OPERACNO from the table. The relationship is only active in the measure calculation, you cant display both columns in the table as the relationship will be inactive there.
/ J
I tryed, not make any sence, result is same
You cant have any columns from table1. Remove all columns from table 1, if there's still duplicates of 64477 after that the issue is related to something else.
But i need to have them
The USERELATIONSHIP() only works within the specific measure. For all the other columns there is no relationship between table 1 and table 2 which is why you can not combine columns from the 2 different tables!
If you can provide an image of all the data you need displayed in your table I can help you accomplish this, but untill then it's very hard to help.
/ J
I want get everything from Table2 and only one value from 'Table1'[DebtSumNacCurrency]
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@Analitika You should share a sample file now, also which one of the two tables is on the many side?
Measure 2 =
CALCULATE (
SUM ( 'Table1'[DebtSumNacCurrency] ),
ALLEXCEPT ( 'Table1', 'Table2'[SkOperacNo] ),
USERELATIONSHIP ( 'Table2'[SkOperacNo], 'Table1'[OPERACNO] )
)
Table2 on many side, your example is not work as i cant set
ALLEXCEPT ( 'Table1',) 'Table2'[SkOperacNo]
@Analitika , saw your update.
Can you share sample data and sample output in table format?
You should be able to remove the filterstatement from the measure :
Measure 2 =
CALCULATE(
sum('Table1'[DebtSumNacCurrency]),
USERELATIONSHIP('Table2'[SkOperacNo],'Table1'[OPERACNO])
)
It has the same function as the userelationship.
I can't really see anything about this measure that would cause an error. Are you trying to add something to the measure? Can you post the exact error message?
/ J
/ r
It give me a wrong total, it sums all table sums but not needed
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
104 | |
79 | |
68 | |
61 |
User | Count |
---|---|
144 | |
104 | |
103 | |
82 | |
70 |