Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
How to use related in measure?
sumX =
VAR multiplier =
IF (
RELATED('units'[MAT_12]) <> BLANK ();
RELATED('units'[MAT_12]);
1
)
RETURN
DIVIDE(
[AllSubNamePrice];
[AllSubNameCount]
)*multiplier
That code do not work
Solved! Go to Solution.
Hi @Analitika
RELATED expects row context and there isn't one there.
Measures expect aggregation, try the below.
sumX =
VAR multiplier =
IF (
SELECTEDVALUE('units'[MAT_12]) <> BLANK ();
SELECTEDVALUE('units'[MAT_12]);
1
)
RETURN
DIVIDE(
[AllSubNamePrice];
[AllSubNameCount]
)*multiplier
Hi @Analitika
RELATED expects row context and there isn't one there.
Measures expect aggregation, try the below.
sumX =
VAR multiplier =
IF (
SELECTEDVALUE('units'[MAT_12]) <> BLANK ();
SELECTEDVALUE('units'[MAT_12]);
1
)
RETURN
DIVIDE(
[AllSubNamePrice];
[AllSubNameCount]
)*multiplier
User | Count |
---|---|
139 | |
113 | |
103 | |
73 | |
63 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |