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
StephenF
Responsive Resident
Responsive Resident

% total of metric breaks when data filtered

I have measure:

 

% Starts = SUM(STREAMS[Playlist Starts]) / SUMX(ALL(STREAMS),[Playlist Starts])

When the table this column appears in is filtered on another dimension, say [date] the denominator acts like its not affected by the filter but the numerator is.

 

How do I change this formula to get the correct results?

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @StephenF,

 

Try this one, please. The structure of your mode is the key point.

 

% Starts =
SUM ( STREAMS[Playlist Starts] )
    / CALCULATE (
        SUMX ( STREAMS, [Playlist Starts] ),
        ALLEXCEPT ( STREAMS, STREAMS[date] )
    )

 

Best Regards,
Dale

Community Support Team _ Dale
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

6 REPLIES 6
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @StephenF,

 

Try this one, please. The structure of your mode is the key point.

 

% Starts =
SUM ( STREAMS[Playlist Starts] )
    / CALCULATE (
        SUMX ( STREAMS, [Playlist Starts] ),
        ALLEXCEPT ( STREAMS, STREAMS[date] )
    )

 

Best Regards,
Dale

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

Hi @StephenF

What exactly are the "correct results" that you wish? Your code acting is acting as it should 

StephenF
Responsive Resident
Responsive Resident

I wish for the denominator to be filtered.

AlB
Community Champion
Community Champion

@StephenF

 

But then you'll always get a 1, won't you? What would be the difference between the numerator and the denominator then?

StephenF
Responsive Resident
Responsive Resident

Yes it will be 1 but it will be correct for that table. The % Total needs to be local to the table object not global.

 

Consider the following end result as example

 

Filter: Date=yesterday

 

Dim1 %Total

dimA 66%

dimB 32%

dimC 2%

Total 100%

 

AlB
Community Champion
Community Champion

@StephenF

 

Maybe if you share the pbix I'd be able to help. It's too little information right now

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.