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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Unknowncharacte
Helper III
Helper III

Filtering Crossfilter Measure

Hi, 

 

I used @amitchandak YouTube video  to calculate this Active Case count.

Now, I need to create a new measure off of this one, and filter only those cases that were opened for => 90 days.

So, I will have an "Active Cases Count of Cases that were open for more than 90 days" measure.

 

Can someone please help me adjust this measure to get only cases that were open for => 90 days?

 

I will then use this measure to divide by Active Cases Count to get a % 

Active Case Count =
CALCULATE
(COUNTx(FILTER('Fact Table', 'Fact Table'[DateOpened]<=max('DIM Calendar'[Full Date])
&& (ISBLANK('Fact Table'[DateClosed])
|| 'Fact Table'[DateClosed]>max('DIM Calendar'[Full Date]))), ('Fact Table'[CaseNumber])),
CROSSFILTER('Fact Table'[DateOpened],'DIM Calendar'[Full Date],None))

 

Sample of my data:

Unknowncharacte_0-1697518675134.png

 

 



1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but try something like below if it works.

 

Active Case Open for 90 days Count =
CALCULATE (
    COUNTX (
        FILTER (
            'Fact Table',
            'Fact Table'[DateOpened] <= MAX ( 'DIM Calendar'[Full Date] )
                && NOT ISBLANK ( 'Fact Table'[DateClosed] )
                    && 'Fact Table'[DateClosed] > MIN ( 'DIM Calendar'[Full Date] )
                    && 'Fact Table'[DateClosed] - 'Fact Table'[DateOpened] >= 90
        ),
        ( 'Fact Table'[CaseNumber] )
    ),
    CROSSFILTER ( 'Fact Table'[DateOpened], 'DIM Calendar'[Full Date], NONE )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but try something like below if it works.

 

Active Case Open for 90 days Count =
CALCULATE (
    COUNTX (
        FILTER (
            'Fact Table',
            'Fact Table'[DateOpened] <= MAX ( 'DIM Calendar'[Full Date] )
                && NOT ISBLANK ( 'Fact Table'[DateClosed] )
                    && 'Fact Table'[DateClosed] > MIN ( 'DIM Calendar'[Full Date] )
                    && 'Fact Table'[DateClosed] - 'Fact Table'[DateOpened] >= 90
        ),
        ( 'Fact Table'[CaseNumber] )
    ),
    CROSSFILTER ( 'Fact Table'[DateOpened], 'DIM Calendar'[Full Date], NONE )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Thank you so much!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.