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
OrM
Frequent Visitor

Filter not affecting Visual, but measure in the visual affected by the filter

Hi everyone,

 

I have encountered one issue in power bi desktop. 

I have a line chart on the page with 2 measures: [Variable 2020] and [Variable 2021]. I have turned off the interaction between the filter and the line chart, otherwise I have only one month in the line chart (the month filter is necessary for other visuals on the page).

 

I want to set up [Variable 2021] so that it will show the data only till selected month, i.e. if February is selected on the month slicer [Variable 2] will show only January & February data and the rest will be blank.  

OrM_1-1615557780386.png

https://community.powerbi.com/t5/Desktop/Line-Chart-until-selected-month/td-p/534468 solution on the provided link is not working for me. Would be pleased if you can help me figure out how to do it. Thank you!

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

You could use a slicer where you can select a date range up until a particular date rather than selecting a single date. If that's not an option, then (I don't know if this is the best practice but) I've solved similar date problems as follows:

 

Make sure you have two calendar tables. The first is the standard date dimension table with a relationship to your fact table. The second is an independent parameter table with no relationships. The standard calendar table is used on your x-axis. The parameter calendar table is used for your slicer. Write measures that read your date slicer and apply that selected date using the logic you want.

 

For example:

 

Filtered Variable 2020 =
VAR DateSelected = SELECTEDVALUE ( DateParam[Date] )
RETURN
    CALCULATE ( [Variable 2020], DateDim[Date] <= DateSelected )

 

 

This way the DateParam table doesn't filter your x-axis since there's no relationship but it's still used to apply a date filter in the measure.

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

You could use a slicer where you can select a date range up until a particular date rather than selecting a single date. If that's not an option, then (I don't know if this is the best practice but) I've solved similar date problems as follows:

 

Make sure you have two calendar tables. The first is the standard date dimension table with a relationship to your fact table. The second is an independent parameter table with no relationships. The standard calendar table is used on your x-axis. The parameter calendar table is used for your slicer. Write measures that read your date slicer and apply that selected date using the logic you want.

 

For example:

 

Filtered Variable 2020 =
VAR DateSelected = SELECTEDVALUE ( DateParam[Date] )
RETURN
    CALCULATE ( [Variable 2020], DateDim[Date] <= DateSelected )

 

 

This way the DateParam table doesn't filter your x-axis since there's no relationship but it's still used to apply a date filter in the measure.

Thank you for your reply, Alexis! On the link provided in the original post the same solution is proposed. But I want to avoid creating an extra month slicer.

I suppose it is not possible without creating an extra slicer.

Yeah, if you want selecting a single month in a drop-down to do something other than selecting a single month on your axis, then you have to make things more complicated.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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