Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi Everyone,
I am total newbie for Power BI, just couple of days hands on. I have a problem that I have not been able to solve till now and I was wondering if you could help me?
I have used a slicer to select data to my clustered column chart. I used following measure to read slicer value (European syntax).
Selected =
CONCATENATEX(
ALLSELECTED('Table1'[Column]);
'Table1'[Column];
";"
)
My plan is to use Selected value in another measure to dynamically calculate the line value. I have used direct query to my SQL Server DB but that should not affect to these calculations.
I tried to use the Selected value in following formula:
Metrics1 = ABS(CALCULATE(MAX('FactTable'[Value]);'DimensionTable'[Column]=[Selected];LASTDATE('Dimension Date'[Calendar_Date]))/(CALCULATE(MIN('FactTable'[Value]);'DimensionTable'[Column]=[Selected];ALLSELECTED('Dimension Date'[Calendar_Date])))-1)
Error message: A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
Your help would be highly appreciated!
Regards,
JuhoP
Solved! Go to Solution.
Hi @JuhoP,
Could you try the formula below to see if it works?
Metrics1 = VAR s = [Selected] RETURN ABS ( CALCULATE ( MAX ( 'FactTable'[Value] ); 'DimensionTable'[Column] = s; LASTDATE ( 'Dimension Date'[Calendar_Date] ) ) / ( CALCULATE ( MIN ( 'FactTable'[Value] ); 'DimensionTable'[Column] = s; ALLSELECTED ( 'Dimension Date'[Calendar_Date] ) ) ) - 1 )
Regards
Hi @JuhoP,
Could you try the formula below to see if it works?
Metrics1 = VAR s = [Selected] RETURN ABS ( CALCULATE ( MAX ( 'FactTable'[Value] ); 'DimensionTable'[Column] = s; LASTDATE ( 'Dimension Date'[Calendar_Date] ) ) / ( CALCULATE ( MIN ( 'FactTable'[Value] ); 'DimensionTable'[Column] = s; ALLSELECTED ( 'Dimension Date'[Calendar_Date] ) ) ) - 1 )
Regards
Hi!
Yes, it works beatifully! Thanks a million!
User | Count |
---|---|
102 | |
91 | |
87 | |
79 | |
71 |
User | Count |
---|---|
113 | |
105 | |
101 | |
75 | |
64 |