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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
yuvanne_11
Frequent Visitor

Filter Option

Hi,

I want to create a measure and use that as a filter. So I am dealing with the inventory dashboard. I have columns such as >4 years, <4 years, < 3 years, < 2 years, and so on. These are in currency format. Now, I want to create a filter with these columns inside, like just the text. So the user can choose for example > 4 years in the filter and the graphs give the inventory information accordingly. Can this be done in Power BI? Looking for something as attached below.

Thanks.

yuvanne_11_0-1661434042373.png

 

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

You cannot use a measure as a filter. What you could do is create a calculated column that evaluates the closing stock date and assigns it the closing stock value. That calculated column could then be used as a filter.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

4 REPLIES 4
yuvanne_11
Frequent Visitor

Oh okay!

Got it. Thank you so much

yuvanne_11
Frequent Visitor

But that calculated column would give the options in numbers, right? Instead I just want the text to be displayed

It would not have to be numbers, it could be text. Here is an example measure;

Date Group =
var _dateDiff =
DATEDIFF(TODAY(),dimDate[Date],YEAR)
Return
SWITCH(
    TRUE(),
    _dateDiff = 0, "Year 2022",
    AND(_dateDiff < 0, _dateDiff >= -1), "Year 2021",
    AND(_dateDiff < -1, _dateDiff >= -2), "Year 2020",
    AND(_dateDiff > 0, _dateDiff <= 1), "Year 2023",
    "Other Year"
)
This measure would produce a column that would show up in a filter like
jgeddes_0-1661518361865.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





jgeddes
Super User
Super User

You cannot use a measure as a filter. What you could do is create a calculated column that evaluates the closing stock date and assigns it the closing stock value. That calculated column could then be used as a filter.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors