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
EmaVasileva
Helper V
Helper V

Dax calc. to filter line chart

Hello,

I need some help with a dax calculation. I have the following type of data which I’m using in a Line chart and in a Control Chart:

Date (dd-mm-yyyy)                       

Title                          

Amount                   

Target                       

04-03-2022              

 AA

 5

 10

05-03-2022

 AA

10

 20

06-03-2022

 AA

 0

 30

07-03-2022

 AA

 15

  

08-03-2022

 AA

 

 25

09-03-2022

 AA

 

 25

 *Every day the Amount field is updated with new information.

Currently, my chart shows all rows with Target, even the Amount cell is empty. I need a dax column/measure to filter my chart, to show only the Target where the Amount field is NOT empty (in the example to load data only to March 7th incl.). If Amount is equal to zero, the target should be displayed. And if there is Amount value, but the target is empty, to still load the row.

Thank you.

1 ACCEPTED SOLUTION

I'd actually meant to apply the filter to the visual using the filter pane, you can choose Advanced filtering -> is not blank.

johnt75_0-1646827718956.png

However, you could try changing your filter to

Column = IF ( NOT( ISBLANK( 'Table'[Amount] ) ), 'Table'[Target], 99999 )

as BLANK() does equate to 0 when using comparison operators.

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

Add a filter to the chart to only show items where Amount is not blank.

Hi @johnt75,

Thank you for the suggestion, but this doesn't work.

I tried to use this calc as a hidden filter: Column = if('Table'[Amount] <> blank(), 'Table'[Target],99999). It 'almost' work fine, because it filters the days, but when Actual is equal to zero, it accepts it as an empty field and doesn't show it.

I'd actually meant to apply the filter to the visual using the filter pane, you can choose Advanced filtering -> is not blank.

johnt75_0-1646827718956.png

However, you could try changing your filter to

Column = IF ( NOT( ISBLANK( 'Table'[Amount] ) ), 'Table'[Target], 99999 )

as BLANK() does equate to 0 when using comparison operators.

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.