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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors