Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Daxmon_23
Frequent 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 DAX ?

IF

[Categories]= 'CANDIES' THEN
{ FIXED

[Unique ID],[Categories]

:
IF

[PRECIO PROMEDIO]<450

THEN 'LESS THAN 500'
ELSEIF

[PRECIO PROMEDIO]>450 AND [PRECIO PROMEDIO] =< 550

THEN '$500'
ELSEIF

[PRECIO PROMEDIO]>550 AND [PRECIO PROMEDIO] =< 650

THEN '$600'
ELSEIF

[PRECIO PROMEDIO]>650 THEN 'MORE THAN  $600'
END

}
END

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

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.

View solution in original post

3 REPLIES 3
v-henryk-mstf
Community Support
Community Support

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
Super User
Super User

@Daxmon_23 , I have done a video in the same sometime back, see if that can help

https://www.youtube.com/watch?v=hU-cVOwDCvY&t=0s

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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])
))

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors