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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
cpassuel
Frequent Visitor

Adding + 0 to a mesure and chart filtering issue with Auto date/time enabled

Hello,

 

I have a table of incidents with a incident creation datetime and an incident id. I created a measure to count the number of incident and added a + 0 to prevent displaying Blank : Nb = COUNTROWS(data)+0

 

On my page, I have a slicer on creation time to filter on the n latest months. When I add this measure on a line or a bar chart, the time slicer is not applied and it displays all the months. I don't really understand why. When I don't add the + 0 in the measure, filter is working as you can see in the picture.

I tried also VAR nb = COUNTROWS(dataRETURN IF(ISBLANK(nb), 0, nb) with no success.
 
How to fix it ? Is is a bug on the visual ?
 

After further investigations, I found that this issue is related to the Auto Date/time feature. When it's enabled, filter does not work properly.

ChartFilterError.png

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

Hi @cpassuel ,

 

+0 forces left join.

In this case you will need to add the slicer as filter condition in the formula:

Measure = 
VAR nb = COUNTROWS(data)+0
var _min = minx(ALLSELECTED('Calendar'), 'Calendar'[Date])
var _max = maxx(ALLSELECTED('Calendar'), 'Calendar'[Date])
return
CALCULATE(if(max('Calendar'[Date]) <_min || max('Calendar'[Date]) >_max , BLANK(), nb ))

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @cpassuel ,

 

+0 forces left join.

In this case you will need to add the slicer as filter condition in the formula:

Measure = 
VAR nb = COUNTROWS(data)+0
var _min = minx(ALLSELECTED('Calendar'), 'Calendar'[Date])
var _max = maxx(ALLSELECTED('Calendar'), 'Calendar'[Date])
return
CALCULATE(if(max('Calendar'[Date]) <_min || max('Calendar'[Date]) >_max , BLANK(), nb ))

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Anonymous
Not applicable

Hi

 

try COUNTROWS(ALLNONBLANKROW(DATA))

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors