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

Emprty string measure break filtering

Hi,

 

I am having some troubles when a measure return an empty string, for example when I use FORMAT(). In this conditions some values appears although the corresponding column is filtered.

 

I reproduced this behaviour in the pbix attached.

Brand table is joined to Range table which is joined to Data table. I then display a Sales measure per range and filter on the Brand table in the page. If I used formatted sales measure, ranges that does not belong to the filtered brand still get displayed.

Note that if I filter on the visual using the brand column of the range table, it works..

 

What is going wrong here ?

 

Thanks for your help

 

PBIX FILE

1 ACCEPTED SOLUTION

@Anonymous -

 

The behavior is probably documented somewhere. There is plenty of documentation on describing how to deal with empty strings.

If you want the slicer to work as what I believe you intended you could use:

Formatted Sales = 
IF(
    ISBLANK([Sales]),
    BLANK(),
    FORMAT([Sales],"Fixed")
)





Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



View solution in original post

3 REPLIES 3
ChrisMendoza
Resident Rockstar
Resident Rockstar

@Anonymous -

 

The documentation, https://docs.microsoft.com/en-us/dax/pre-defined-numeric-formats-for-the-format-function, "If value is BLANK() the function returns an empty string.

 

Why not use the Formatting Formats that are built in to display Decimal instead of converting the numbers to Text?






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Anonymous
Not applicable

I know that FORMAT return empty strings. 
I already use the built in format but I want a different format for one specific column, thus FORMAT() helps me to achieve this.

 

The issue here is not about formatting numbers but rather understand why empty strings "break" the tables filtering.

@Anonymous -

 

The behavior is probably documented somewhere. There is plenty of documentation on describing how to deal with empty strings.

If you want the slicer to work as what I believe you intended you could use:

Formatted Sales = 
IF(
    ISBLANK([Sales]),
    BLANK(),
    FORMAT([Sales],"Fixed")
)





Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



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.