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
Anonymous
Not applicable

DAX Switch is picking up Blank values in 0 to 1 Range

Hi,

 

I am working on a report and have a measured column like this:

armughan_0-1632324725545.png

this column is ranges for distribution but the problem is, dax picks up blank values and place them in 0 to 1 and it messes up everything.

Also, if I use ISBLANK then 0-1 is missing and there is no option to see it in visuals.

 

please help.

 

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

Hi @Anonymous 

Create a calculated column like this :

Ranges 1 = SWITCH(TRUE(),ISBLANK('Table'[length]),BLANK(),
                       'Table'[length]>=0 && 'Table'[length]<1,"0 to 1",
                       'Table'[length]>=1 && 'Table'[length]<2,"1 to 2",
                       'Table'[length]>=2 && 'Table'[length]<3,"2 to 3",
                       'Table'[length]>=3 && 'Table'[length]<4,"3 to 4",
                       'Table'[length]>=4 && 'Table'[length]<5,"4 to 5")

The final result is as shown :

Ailsamsft_0-1632798473226.png

I have attached my pbix file ,you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

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-yetao1-msft
Community Support
Community Support

Hi @Anonymous 

Create a calculated column like this :

Ranges 1 = SWITCH(TRUE(),ISBLANK('Table'[length]),BLANK(),
                       'Table'[length]>=0 && 'Table'[length]<1,"0 to 1",
                       'Table'[length]>=1 && 'Table'[length]<2,"1 to 2",
                       'Table'[length]>=2 && 'Table'[length]<3,"2 to 3",
                       'Table'[length]>=3 && 'Table'[length]<4,"3 to 4",
                       'Table'[length]>=4 && 'Table'[length]<5,"4 to 5")

The final result is as shown :

Ailsamsft_0-1632798473226.png

I have attached my pbix file ,you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

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

@Anonymous , Can you share a sample pbix after removing sensitive data.

 

Add first condition like

isblank([Length]), blank() ,

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.