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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Bar chart of measure x-axis does not respond to date slicer

Hi there,

I have two measures I am plotting in a bar chart (I use two so I can color them different colors, one for positive differences, one for negative differences). However, although the date slicer I am using works for charts of raw data (the data and x-axis is filtered), the bar chart of these measures filters the data, but not the x-axis of the chart. How do I get the chart to filter the x-axis based on the slicer too?

 

The two measures:

 

DayDiffNegative = if(DISTINCTCOUNT(dat4[id]) - DISTINCTCOUNT(dat4[gin]) < 0, DISTINCTCOUNT(dat4[id]) - DISTINCTCOUNT(dat4[gin]), 0)

 

DayDiffPositive = if(DISTINCTCOUNT(dat4[id]) - DISTINCTCOUNT(dat4[gin]) > 0, DISTINCTCOUNT(dat4[id]) - DISTINCTCOUNT(dat4[gin]), 0)

 

The chart, showing the problem, at the right hand end of the x-axis:

Capture.PNG

 

Any help would be appreciated,

Regards,

Will

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I managed to solve it. Just needed to use BLANK() instead of zeroes in the IF statement...

 

DayDiffNegative = if(DISTINCTCOUNT(dat4[id]) - DISTINCTCOUNT(dat4[gin]) < 0, DISTINCTCOUNT(dat4[id]) - DISTINCTCOUNT(dat4[gin]), BLANK())

 

DayDiffPositive = if(DISTINCTCOUNT(dat4[id]) - DISTINCTCOUNT(dat4[gin]) > 0, DISTINCTCOUNT(dat4[id]) - DISTINCTCOUNT(dat4[gin]), BLANK())

View solution in original post

2 REPLIES 2
21818
Frequent Visitor

Hi, 

 

I am having the same issue and your solution was not working for me. As you can see from picture below, when I change the date slicer those values not included in the selected date period appear as zero (highlited values). I would like that the x-axis was changed according to the date slicer in order to show only the desired time period. 

Capture.JPG

The measure I am using is the following:

Measure =CALCULATE( DIVIDE(SUM(A),SUM(B),BLANK()))

 

Thanks in advance for any help! 

Anonymous
Not applicable

I managed to solve it. Just needed to use BLANK() instead of zeroes in the IF statement...

 

DayDiffNegative = if(DISTINCTCOUNT(dat4[id]) - DISTINCTCOUNT(dat4[gin]) < 0, DISTINCTCOUNT(dat4[id]) - DISTINCTCOUNT(dat4[gin]), BLANK())

 

DayDiffPositive = if(DISTINCTCOUNT(dat4[id]) - DISTINCTCOUNT(dat4[gin]) > 0, DISTINCTCOUNT(dat4[id]) - DISTINCTCOUNT(dat4[gin]), BLANK())

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors