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
littlemojopuppy
Community Champion
Community Champion

Retaining Date Slicers in Measure Calculations

Good afternoon!  Would like to ask for some help if anyone is willing.

 

I have this:

Annotation 2019-10-27 121645.png
Dates are filtered in the slicer AND there is a filter in each of the gauges for most recent calendar month.  The measure for no-show advance cancel and same day cancel rates all calculate fine.  The problem is the measure for target...I'm intending to calculate the organizational rate regardless of any values selected in any slicer but still keep the date slicer for the most recent calendar month.  Here's code for the no-show rate (other two are almost identical):

Organization No Show Rate = 
    VAR
        NoShows =
            COUNTROWS(
                FILTER(
                    ALLEXCEPT(
                        'Patient No Shows',
                        'Patient No Shows'[ApptStart]
                    ),
                    'Patient No Shows'[Status] = "No show"
                )
            )
    VAR
        OutpatientVisits = 
            SUMX(
                FILTER(
                    ALLEXCEPT(
                        'Actual Visits',
                        'Actual Visits'[Period]
                    ),
                    'Actual Visits'[OP/IP/DEL] = "OP"
                ),
                'Actual Visits'[Actual Encounters]
            )
    VAR
        TotalVisits = OutpatientVisits + NoShows
    RETURN

    DIVIDE(
        NoShows,
        TotalVisits,
        BLANK()
    )

This is calculating the historical no-show rate for all time - it's ignoring all date filters.  And I believe it's because of the ALLEXCEPT function.

 

I think that the solution would involve using the EARLIER function to keep the date filter from the gauge, but I've tried a couple of different times and I either get errors or results that don't make any sense.  Would anyone offer some advice on how to correct this?

 

Thank you!

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

@littlemojopuppy ,

 

Could you please share sample data and give the expected result?

 

Regards,

Jimmy Tao

I can't share data because it would violate just about every HIPAA rule that exists.

The expected result is to calculate the rates for the most recent calendar month for which data is available.  The formula is mostly laid out...it comes down to limiting it to just the most recent month.

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.