Percent of total with filters

I’m calculating a percentage of total services and these DAX expressions give the intended result.

Services =
CALCULATE( DISTINCTCOUNT( ‘Journal Table’[ID Count] ), FILTER( ‘Journal Table’, ‘Journal Table’[Void Flag] <> “Y” || ‘Journal Table’[Journal Code] <> “A” || ‘Journal Table’[Journal Code] <> “C” || ‘Journal Table’[Journal Code] <> “E” || ‘Journal Table’[Journal Code] <> “P” || ‘Journal Table’[Journal Code] <> “U” ) )

Percent of Total =
VAR Denominator = CALCULATE( [Services], REMOVEFILTERS( ‘Journal Table’ ), SUMMARIZE( ‘Journal Table’, ‘Journal Table’[Unit ID], ‘Journal Table’[SubUnit ID], ‘Journal Table’[Journal Code], ‘Journal Table’[Void Flag] ), SUMMARIZE( ‘Date Table’, ‘Date Table’[MonthShortName] ))

RETURN
DIVIDE( ‘Journal Measures’[Services], Denominator, 0 )

image

Is it possible to filter out Service ID 700 and still have the total equal 100%?

image
Percent of Total.pbix (2.9 MB)

Hello @RDW,

Thank You for posting your query onto the Forum.

To achieve the results of 100% at a grand total level. Just create a measure as provided below alongwith the screenshot of the final results provided for the reference -

Percent of Total - Harsh = 
DIVIDE( 
    [Services] , 
    CALCULATE( [Services] , 
        ALLSELECTED( 'Journal Table'[Unit ID] ) , 
        ALLSELECTED( 'Journal Table'[SubUnit ID] ) , 
        ALLSELECTED( 'Journal Table'[Service ID] ) ) , 
    0 )

I’m also attaching the working of the PBIX file for the reference purposes.

Hoping you find this useful and meets your requirements that you’ve been looking for. :slightly_smiling_face:

Thanks and Warm Regards,
Harsh

Percent of Total - Harsh.pbix (2.9 MB)

Hi @Harsh, it works perfectly. Thanks for your help!

Hello @RDW,

You’re Welcome. :slightly_smiling_face:

I’m glad that I was able to assist you.

Thanks and Warm Regards,
Harsh