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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Create a filter based on a measure

I have a dataset with a lot of tickets.

A tickets has an id, an open date, a start date and a close date.

 

The end user has to possibility to select a single date and this will change the status of the tickets.

 

For example:

 

ID, Open Date, Start Date, Close Date

1, 01/01/2019, 10/02/2019, 12/03/2019

2, 01/02/2019, 10/01/2019, 12/01/2019

 

If the date selected is between Open Date and Start Date a ticket is open, if is between Start Date and Close Date the ticket is started, if is after Close Date the ticket is Closed.

 

I'd like to have a filter that on the context of the data selected, will give only the open, or the started, or the closed tickets.

 

I can't do it with a measure because I can't set a measure as a filter and I can't do it with a calculated column because is not dynamic.

 

I tried to implement the solution posted here https://community.powerbi.com/t5/DAX-Commands-and-Tips/Create-a-filter-based-on-a-measure/m-p/830277 , but the filter will apply only to the table with the value of the status and not on the other visuals (for example card, other measures without the status ecc.)

 

Any suggestion if it is possible to have a filter on the status the will filter also all the other data like a normal filter?

1 REPLY 1
Anonymous
Not applicable

Create one dummy date table.

WHich is

Calendar=Calenderauto(01/01/2016,12/31/2020)

 

Create new measure

Filter = IF(MIN(Table2[ Open Date])<=MIN('Calendar'[Date]) && MIN(Table2[ Start Date])>=MIN('Calendar'[Date]),"Open",
IF(MIN(Table2[ Start Date])<=MIN('Calendar'[Date]) && MIN(Table2[ Close Date])>=MIN('Calendar'[Date]),"Started",
IF(MIN(Table2[ Close Date])<=MIN('Calendar'[Date]),"Closed")))
 
And add it in visual level filter.
from there you can set it to any value that is "Open","Started","Closed".
Capture1.PNG
 
 
 
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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