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.
Hi,
I want below Tableau calculated field to be worked in power BI (Measure or Column) as i have to give the color basis on the value available in Power BI.
IF ZN([Calculation) = 0 THEN "No Qty in Scenario"
ELSEIF (ZN([Calculation]) - LOOKUP(ZN([Calculation]),FIRST())) = 0 THEN "Qty = Baseline"
ELSEIF (ZN([Calculation]) - LOOKUP(ZN([Calculation]),FIRST())) > 0 THEN "Qty > Baseline"
ELSEIF (ZN([Calculation]) - LOOKUP(ZN([Calculation]),FIRST())) < 0 THEN "Qty < baseline"
Solved! Go to Solution.
@kasai16 , First create a measure for calculation
Calculation = SUM('YourTable'[YourColumn])
Then for Lookup value
BaselineValue =
CALCULATE(
[Calculation],
FIRSTNONBLANK('YourTable'[YourColumn], 1)
)
In the end final measure for conditional logic
dax
QtyStatus =
VAR CurrentCalculation = [Calculation]
VAR BaselineCalculation = [BaselineValue]
RETURN
IF(
ISBLANK(CurrentCalculation) || CurrentCalculation = 0,
"No Qty in Scenario",
IF(
CurrentCalculation - BaselineCalculation = 0,
"Qty = Baseline",
IF(
CurrentCalculation - BaselineCalculation > 0,
"Qty > Baseline",
"Qty < Baseline"
)
)
)
Now you can use QTY status in conditional formatting of visual
Proud to be a Super User! |
|
@kasai16 , First create a measure for calculation
Calculation = SUM('YourTable'[YourColumn])
Then for Lookup value
BaselineValue =
CALCULATE(
[Calculation],
FIRSTNONBLANK('YourTable'[YourColumn], 1)
)
In the end final measure for conditional logic
dax
QtyStatus =
VAR CurrentCalculation = [Calculation]
VAR BaselineCalculation = [BaselineValue]
RETURN
IF(
ISBLANK(CurrentCalculation) || CurrentCalculation = 0,
"No Qty in Scenario",
IF(
CurrentCalculation - BaselineCalculation = 0,
"Qty = Baseline",
IF(
CurrentCalculation - BaselineCalculation > 0,
"Qty > Baseline",
"Qty < Baseline"
)
)
)
Now you can use QTY status in conditional formatting of visual
Proud to be a Super User! |
|
User | Count |
---|---|
82 | |
78 | |
67 | |
46 | |
45 |
User | Count |
---|---|
105 | |
44 | |
39 | |
39 | |
39 |