Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello,
I have following measure which doesn't work when i am using variable varRank2 as a condition with CurrentVal.
Ratio Kms For Rank2 To Actual =
VAR varRank2 = 'FPOC Main'[Rank 2 Kms By Month]
VAR TotalActual =
CALCULATE(
MAX('FPOC Main'[ActualSumFromViewSummary]),
'FPOC Main'[FPOC_Date] = SELECTEDVALUE(DimDate[DateInDateFormat])
)
VAR CurrentVal =
CALCULATE(
SUM('FPOC Main'[kms]),
FILTER(
'FPOC Main',
'FPOC Main'[Measurement_End_Code] = varRank2
)
)
VAR Ratio =
DIVIDE(
CurrentVal,
TotalActual,
0
)
RETURN
CurrentVal
varRank2 returns text value which should filter 'FPOC Main' table to second Measure_End_Code name based on calculated percentage.
Measure Rank 2 Kms By Month is calculated as follows:
Rank 2 Kms By Month =
CALCULATE(
MAX('FPOC Main'[Measurement_End_Code]),
FILTER(
VALUES('FPOC Main'[Measurement_End_Code]),
RANKX(
ALL('FPOC Main'[Measurement_End_Code]),
CALCULATE('FPOC Main'[% Kms By Month]))=2
)
)
and when i put that value in card visual it shows correct value. Further more, there are also Rank1 measures build in the same way and those seems to work, so filter expression in CurrentVal works.
One more thing, when i put literal value instead of a variable value it works.
Can't figure it out, no idea what is going on.
Any help?
@Anonymous , I think you should try new Index function , that can help
Power BI Index function: Top/Bottom Performer by name and value- https://youtu.be/HPhzzCwe10U
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |