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.
Is it possible to convert the following calculated column to measure?
field widget =
var minimum =
LOOKUPVALUE('Virtual Table'[value], 'Virtual Table'[product_id],'Virtual Table'[product_id], 'Virtual Table'[type], "min")
var maximum =
LOOKUPVALUE('Virtual Table'[value], 'Virtual Table'[product_id],'Virtual Table'[product_id], 'Virtual Table'[type], "max")
var diff =
(maximum - minimum)
var mean =
DIVIDE((LOOKUPVALUE('Virtual Table'[value],'Virtual Table'[product_id],'Virtual Table'[product_id],'Virtual Table'[type],"mean")-minimum),diff)
var wavg =
DIVIDE((LOOKUPVALUE('Virtual Table'[value], 'Virtual Table'[product_id],'Virtual Table'[product_id], 'Virtual Table'[type], "wavg")-minimum),diff)
var pp =
DIVIDE((LOOKUPVALUE('Virtual Table'[value], 'Virtual Table'[product_id],'Virtual Table'[product_id], 'Virtual Table'[type], "pp")-minimum),diff)
RETURN
ABS(IF('Virtual Table'[type] = "mean",mean,
IF('Virtual Table'[type] = "wavg",wavg,
IF('Virtual Table'[type] = "min",0,
IF('Virtual Table'[type] = "max",1,
IF('Virtual Table'[type] = "product_price",pp, BLANK()))))))
Solved! Go to Solution.
I think you can reuse this with just a few changes. In each of your LOOKUPVALUE calls, wrap the third parameter in SELECTEDVALUE(), and do the same thing in each of the IF statements - replace 'Virtual Table'[type] with SELECTEDVALUE('Virtual Table'[type])
I think you can reuse this with just a few changes. In each of your LOOKUPVALUE calls, wrap the third parameter in SELECTEDVALUE(), and do the same thing in each of the IF statements - replace 'Virtual Table'[type] with SELECTEDVALUE('Virtual Table'[type])
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 |
---|---|
47 | |
24 | |
20 | |
15 | |
13 |
User | Count |
---|---|
55 | |
48 | |
43 | |
19 | |
19 |