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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pbiforum123
Post Patron
Post Patron

Performance issue in the DAX. Please help!

IF(
ISBLANK([2.01 QoQ]),
"N",
SWITCH(TRUE(),
[2.01 QoQ] > -0.1 && [2.01 QoQ] < 0, "A", --"#F2B431",
[2.01 QoQ] <= -0.1 , "R",--"#45BF61",
[2.01 QoQ] >= 0, "G"--"#EF5353",

))


Above DAX is creating performance issue and it is throwing "visual exceeded available resources" error. I tried using the below DAX I am getting incorrect output not sure why? Can you please suggest a different DAX which can overcome the performance issue and the output.

 

DAX:1
SWITCH(TRUE(),
[2.01 QoQ] > -0.1 && [2.01 QoQ] < 0, "A", --"#F2B431",
[2.01 QoQ] <= -0.1 , "R",--"#45BF61",
[2.01 QoQ] >= 0, "G",--"#EF5353",
"N"
)

DAX:2

SWITCH(TRUE(),
[2.01 QoQ] > -0.1 && [2.01 QoQ] < 0, "A", --"#F2B431",
[2.01 QoQ] <= -0.1 , "R",--"#45BF61",
[2.01 QoQ] >= 0, "G",--"#EF5353",
[2.01 QoQ] = BLANK(),"N"
)

 

@amitchandak 

1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

Hi @pbiforum123 ,

I have created a simple sample, please refer to my pbix file to see if it helps you.

Create a column.

Column 4 = 
SWITCH (
    TRUE (),
    ISBLANK ( 'Table'[2.01 QoQ] ), "N",
    'Table'[2.01 QoQ] > -0.1
        && 'Table'[2.01 QoQ] < 0, "A",
    'Table'[2.01 QoQ] <= -0.1, "R",
    'Table'[2.01 QoQ] >= 0, "G"
)

 

vpollymsft_0-1675303930805.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

2 REPLIES 2
v-rongtiep-msft
Community Support
Community Support

Hi @pbiforum123 ,

I have created a simple sample, please refer to my pbix file to see if it helps you.

Create a column.

Column 4 = 
SWITCH (
    TRUE (),
    ISBLANK ( 'Table'[2.01 QoQ] ), "N",
    'Table'[2.01 QoQ] > -0.1
        && 'Table'[2.01 QoQ] < 0, "A",
    'Table'[2.01 QoQ] <= -0.1, "R",
    'Table'[2.01 QoQ] >= 0, "G"
)

 

vpollymsft_0-1675303930805.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-rongtiep-msft Thanks a lot! It is similar to the one in the DAX: 2 which I have shared above which was not giving correct output. Anyway will try and let you know about it.

 

Sorry will not be able to share the original file and also if I need to share the file with sample data then also it will take lots of time to create it as it as so 100's of DAXs. Hope you can understand!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.