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
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
Employee
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
Employee
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
Super User
Super User

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.

@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%

 

@StephenF

 

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

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.

Top Solution Authors