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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
blissgrn
New Member

Filter charts with measure

Hi,


I have this measure that filters data according to a range (columns: startdate, enddate).


Range =
var StartRange = FIRSTDATE('Data Table'[Date])
var EndRange = LASTDATE('Data Table'[Date])
var StartDate = SELECTEDVALUE(Pyramid[startdate])
var EndDate = SELECTEDVALUE(Pyramid[enddate])
return if ((EndDate <> BLANK() && ((StartDate <= StartRange && EndDate >= StartRange) || (StartDate >= StartRange && StartDate <= EndRange))) || (EndDate == BLANK() && StartDate <= EndRange), 1,0)

Then I created two charts filtered by this measure.


The first one :

 

img1.png

 

The second one :

 

img2.png

 

The only difference between both charts is that I added the startdate and the enddate in the Y axe.


Now both charts displays different results. The first one is the correct one :

 

img3.png

 

I don't understand why the second one does not display the same data, as the only filter should be the range.

Without specifying explicitly the startdate and enddate, the data is not correct, which causes me some issues with charts that only allow one entry.


Could someone explain this to me?

What could I do to make the second chart work without specifying the startdate and enddate?

 

Here the pbix: File 


Thank you!

 

1 REPLY 1
Anonymous
Not applicable

Hi @blissgrn ,

In your first chart, you’re using [startdate] and [enddate] as part of your Y-axis, which means each row in your data is considered unique based on the combination of [startdate],[enddate],[interval],and [sex]. This results in a more detailed view of your data.

In the second chart, you’ve removed [startdate] and [enddate] from your Y-axis. This means that rows with the same and are considered identical and their values are aggregated together. This results in a less detailed, more summarized view of your data.


Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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