Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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! |
|
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |