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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
viferenc
Helper II
Helper II

Measure with variable filter (year)

Dear All,

 

I would need your help as I do not manage by myself to solve my problem

 

I have simple measure 

 

Volume Growth rate = ((calculate((calculate(sum('Tint Sales'[Volume]);'Tint Sales'[CATEGORY_ID] >= 1;'Tint Sales'[CATEGORY_ID]<= 4;'Year'[Year]=2017)+calculate(sum('Tint Sales'[Volume]);'Tint Sales'[CATEGORY_ID] = 6));'Year'[Year]=2017))/(calculate((calculate(sum('Tint Sales'[Volume]);'Tint Sales'[CATEGORY_ID] >= 1;'Tint Sales'[CATEGORY_ID]<= 4;'Year'[Year]=2016)+calculate(sum('Tint Sales'[Volume]);'Tint Sales'[CATEGORY_ID] = 6));'Year'[Year]=2016)))-1

 

In this measure the years are fix. But I would like to change it to variable, if I would choose the in the year filter 2017 in the first part of the measure should be stay 2017 and in the second part 2016. The same if I choose in the filter 2016, in the first part should stay 2016 and in the second part should stay 2015. 

 

I would really appreciate if somebody could help me

 

Thank you in advance

 

Feri

 

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@viferenc

 

Assuming that you are using a slicer with year column

 

2 measures

 

Year=Values(Year[Year])

 

Year-1=Values(Year[Year])-1

 

or you can replace it in your measure 

 




Lima - Peru

View solution in original post

3 REPLIES 3
Vvelarde
Community Champion
Community Champion

@viferenc

 

Assuming that you are using a slicer with year column

 

2 measures

 

Year=Values(Year[Year])

 

Year-1=Values(Year[Year])-1

 

or you can replace it in your measure 

 




Lima - Peru

Thank you very much for the quick help. It works properly. Best regards Feri

Hi @viferenc,

I am very gald you have resloved your issue, please mark the right reply as answer. So that other people having similar problems will find workaround easily. Thanks for understanding.

Best Regards,
Angelia

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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