Forum Discussion
Anonymous
8 years agoNot applicable
Previous Value from slicer selection
Hi, Wondering if anyone can help me on this one: I have the following simple measure: Total = COUNTROWS('Fleet (Cars)') In another table we have the labels for year ranges such as: ...
- Anonymous8 years ago
Hi again,
Just to let you know we've managed to figure it out with the following:
var a = CALCULATE(Max('Ranges'[Index])-1) var b = CALCULATE(
DISTINCTCOUNT('Fleet (Cars)'[id]);
filter(
ALL('Fleet (Cars)');true());'Ranges'[Index]=a;) return bRegards,
Matt
Zubair_Muhammad
Community Champion
8 years agoHi Anonymous
Give this a shot
Previous =
CALCULATE (
COUNTROWS ( 'Fleet (Cars)' ),
FILTER (
ALL ( 'Ranges'[Index] ),
'Ranges'[Index]
= SELECTEDVALUE ( 'Ranges'[Index] ) - 1
)
)Anonymous
8 years agoNot applicable
Thanks Zubair_Muhammad but getting a multiple column error on this one:
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
- Zubair_Muhammad8 years ago
Community Champion
Hi Anonymous
Could you show me a screen shot? or share the file?
How are the tables related?
- Anonymous8 years agoNot applicable
Relation is a bidireccional one to many between the IDs of the ranges:
Zubair_Muhammad Thanks for your assistance!
Matt
- Anonymous8 years agoNot applicable
Hi again,
Just to let you know we've managed to figure it out with the following:
var a = CALCULATE(Max('Ranges'[Index])-1) var b = CALCULATE(
DISTINCTCOUNT('Fleet (Cars)'[id]);
filter(
ALL('Fleet (Cars)');true());'Ranges'[Index]=a;) return bRegards,
Matt