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

How to create a filter with two different crieteria on different tables?

Hello, 

 

I have a table of opened and closed tickets. All I need to do is to create another table of dates and count how many tickets were opened (I mean, not closed) on that specific day. 

eg: 

If a have my tickets in a fact table like this:

awganzarolli_0-1628196665388.png

 

 

i have to obtain a summarized table considering the status, open and last update columns in order to have how many tickets are open on that day. Using the same table above as an example:

awganzarolli_1-1628197032532.png

 

it has show the historical data of how many tickets were "Under work" on that day. 

 

I´m very pleased you help me and thanks a lot.

 

1 ACCEPTED SOLUTION

Hi @awganzarolli ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want.

1. Create a date dimension table: Tickets by Date

2. Create a measure as below to get the backlog

Backlog = 
VAR _curdate =
    SELECTEDVALUE ( 'Tickets by Date'[Date] )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( 'Tickets'[Id] ),
        FILTER (
            'Tickets',
            'Tickets'[Open] <= _curdate
                && IF ( 'Tickets'[Status] = "Closed", 'Tickets'[Last Update] >= _curdate, 1 = 1 )
        )
    )

yingyinr_0-1628479249002.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
awganzarolli
Frequent Visitor

For that I was thinking to use filter formula like this: 

countrows(CALCULATETABLE(Tickets, Tickets[openDate] <= 'Tickets by Date'[Date], Tickets[UpdatedDate] <= 'Tickets by Date'[Date], Tickets[Status] = "Closed")))

But it return an multiple table reference error.

Hi @awganzarolli ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want.

1. Create a date dimension table: Tickets by Date

2. Create a measure as below to get the backlog

Backlog = 
VAR _curdate =
    SELECTEDVALUE ( 'Tickets by Date'[Date] )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( 'Tickets'[Id] ),
        FILTER (
            'Tickets',
            'Tickets'[Open] <= _curdate
                && IF ( 'Tickets'[Status] = "Closed", 'Tickets'[Last Update] >= _curdate, 1 = 1 )
        )
    )

yingyinr_0-1628479249002.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.