The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Can someone help me to convert below Tableau calculation field or formulla to Power Bi....
IF ATTR([Column Name])!="Column Value" THEN IF (ZN([Parameter A]) - LOOKUP(ZN([Parameter A]), FIRST())) / ABS(LOOKUP(ZN([Parameter A]), FIRST())) != -1 THEN ZN([Parameter A]) - LOOKUP(ZN([Parameter A]), FIRST()) END END
Solved! Go to Solution.
Try with below Dax code and compare the output results b/w Tableau and Power Bi Calculated columns.
Result =
IF (
NOT(ISBLANK('Table'[Column Name])) && 'Table'[Column Name] <> "Column Value",
VAR ParameterA = 'Table'[Parameter A]
VAR FirstParameterA = CALCULATE(
FIRSTNONBLANK('Table'[Parameter A], 1),
FILTER(ALL('Table'), 'Table'[Column Name] <> "Column Value")
)
RETURN
IF (
ParameterA <> BLANK() && FirstParameterA <> BLANK() && FirstParameterA <> 0,
(ParameterA - FirstParameterA) / ABS(FirstParameterA),
BLANK()
)
)
Replace with PowerBI table names and columns.
Thanks for helping. however, it is not working and getting error stating Consider using the VALUE or FORMAT function to convert one of the values., Can you help bit more in simple way please?
Here in the below formullas - Column name is from Table or Data source table and Column value is the value showing under column name. Measure and Measure2 are the calculated fileds from Tableau.
Formulla 1
IF ATTR([Column Name])!="Column Value" THEN IF (ZN([Measure]) - LOOKUP(ZN([Measure]), FIRST())) / ABS(LOOKUP(ZN([Measure]), FIRST())) != -1 THEN ZN([Measure]) - LOOKUP(ZN([Measure]), FIRST()) END END
Formulla 2
IF ATTR([Column Name])!="Column Value" THEN IF (ZN([Measure]) - LOOKUP(ZN([Measure]), FIRST())) / ABS(LOOKUP(ZN([Measure]), FIRST())) != -1 THEN (ZN([Measure]) - LOOKUP(ZN([Measure]), FIRST())) / ABS(LOOKUP(ZN([Measure]), FIRST())) END END
Formulla 3
IF ATTR([Column Name])!="Column Value" THEN IF (ZN([Measure]) - LOOKUP(ZN([Measure]), FIRST())) / ABS(LOOKUP(ZN([Measure]), FIRST())) != -1 THEN ZN([Measure2]) - LOOKUP(ZN([Measure2])) END END
Try with below Dax code and compare the output results b/w Tableau and Power Bi Calculated columns.
Result =
IF (
NOT(ISBLANK('Table'[Column Name])) && 'Table'[Column Name] <> "Column Value",
VAR ParameterA = 'Table'[Parameter A]
VAR FirstParameterA = CALCULATE(
FIRSTNONBLANK('Table'[Parameter A], 1),
FILTER(ALL('Table'), 'Table'[Column Name] <> "Column Value")
)
RETURN
IF (
ParameterA <> BLANK() && FirstParameterA <> BLANK() && FirstParameterA <> 0,
(ParameterA - FirstParameterA) / ABS(FirstParameterA),
BLANK()
)
)
Replace with PowerBI table names and columns.