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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
LEPR
Frequent Visitor

Filter dates on a graph doesn't work with measure

Hi everyone,

 

I am displaying some data in a line and column chart. I have a filter for this chart to display the last 12 months only. I am using a separate Date table linked to my main dataset.

LEPR_0-1704722922871.png

At first, I wanted the orange line (DETAILSUM) to show 0 values as well, and avoid the gaps when there is no data.

I found on this forum that I should create a measure like 

Detailsumcalc = SUM(CIM_INVOICE[DETAILSUM])+0
to do it. And it works ! But now the filter doesn't apply to this measure, and I get all the previous month displayed as well. The purple line is the Detailsumcalc, and the measure is in the same set CIM_INVOICE.
 
LEPR_1-1704723285647.png

 

I couldn't find any workaround so far, so any idea would be appreciated.

 

Thank you

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @LEPR,

Power bi chart will auto hide the blank parts, if you added +0 after the expression, they will expand the calculation range to all table rows.

I think you need to add if statement to check the current row contents /filter effect and add +0 to the specific expression instead of directly add on the whole table level .

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
VijayP
Super User
Super User

@LEPR 

You must add the date field to the Filtern pane and select the date range. Measures never control a filter pane




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


LEPR
Frequent Visitor

Hi Vijay,

Thanks for coming back to me on this topic, I am afraid I didn't get your point.

The date is already in the filter panel for this visual, and it works as long as I have only normal fields in my graph, but not with this new measure that calculates 0 when there is no data in the months.

LEPR_0-1704788466468.png

Thanks

 

 

Anonymous
Not applicable

Hi @LEPR,

Power bi chart will auto hide the blank parts, if you added +0 after the expression, they will expand the calculation range to all table rows.

I think you need to add if statement to check the current row contents /filter effect and add +0 to the specific expression instead of directly add on the whole table level .

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors