Forum Discussion
Daxmon_23
3 years agoFrequent Visitor
From Tableau Fixed function to Power BI DaX
Hi everyone, I am trying to move my reports from Tableau to Power BI and i have some below FIXED function which should be written in DAX. Can any one please help to convert Tableau LOD to Power BI ...
- 3 years ago
Hi Daxmon_23 ,
Change your formula like below:
Cump = VAR a = SWITCH ( TRUE (), [Precio Prom] < 450, "0-$450", AND ( [Precio Prom] > 450, [Precio Prom] <= 550 ), "$500", AND ( [Precio Prom] > 550, [Precio Prom] <= 650 ), "$600", [Precio Prom] >= 600, "More than $600" ) RETURN CALCULATE ( a, ALLEXCEPT ( Sales, Sales[UniqueID] ), ALLEXCEPT ( Product, Product[Categories] ) )or maybe:
Cump = VAR a = SWITCH ( TRUE (), MAX ( DimProduct[Color] ) = "Red", "red", AND ( MAX ( DimProduct[Color] ) = "Black", ( MAX ( DimProduct[Color] ) = "Grey" ) ), "grey", "Other color" ) RETURN CALCULATE ( a, ALLEXCEPT ( DimDate, DimDate[FiscalYear] ) )If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
3 years agoSuper User
Daxmon_23 , I have done a video in the same sometime back, see if that can help
- Daxmon_233 years agoFrequent Visitor
hi amitchandak , thanks for your help.
My try after seeing it was as follows but I get errors I can't seem to find why
Cump =CALCULATE(SWITCH(TRUE(),[Precio Prom] < 450, "0-$450",AND ([Precio Prom] >450, [Precio Prom] <=550),"$500",AND ([Precio Prom] >550, [Precio Prom] <=650),"$600",[Precio Prom] >= 600, "More than $600",ALLEXCEPT(Sales,Sales[UniqueID]),ALLEXCEPT(Product,Product[Categories])))