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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
AmberJane
Helper III
Helper III

% of filtered columns

For this report I have a filter to show me just closed tickets and I want to do a % of the types of closure reasons from the total number of the closed tickets. So I would expect to see 83% resolved, 16% Declined and 1% Declined - Too Old to Fix. Keeping in mind that we may add more closure reasons down the line. 

 

 

AmberJane_0-1645192912990.png

 

 

3 REPLIES 3
AmberJane
Helper III
Helper III

In my current report I added the measure: 

 

Closure Reason % =
VAR sum_ =
CALCULATE (
SUM ( 'PM Tickets'[Linked Ticket ID] ),
FILTER ( ALL ( 'PM Tickets' ), 'PM Tickets'[Linked State] = SELECTEDVALUE ( 'PM Tickets'[Linked State] ) )
)
VAR count_ =
CALCULATE ( SUM ( 'PM Tickets'[Linked State] ), ALLEXCEPT ( 'PM Tickets', 'PM Tickets'[Closure Reason]) )
RETURN
count_ / sum_
 
Before adding the new measure to the report it looks like this:
 
AmberJane_0-1645628355950.png

After adding the new column to the report I receive this error: 

 

AmberJane_1-1645628442955.png

 

I created test data which I will attach. In this case the measure does work without erroring but the %'s are wrong. 

 

 

 

 

v-henryk-mstf
Community Support
Community Support

Hi @AmberJane ,

 

According to your description, I did a test reference as follows:

M_count =
VAR sum_ =
    CALCULATE (
        SUM ( 'Table'[Col] ),
        FILTER ( ALL ( 'Table' ), 'Table'[State] = SELECTEDVALUE ( 'Table'[State] ) )
    )
VAR count_ =
    CALCULATE ( SUM ( 'Table'[Col] ), ALLEXCEPT ( 'Table', 'Table'[Reason] ) )
RETURN
    count_ / sum_

vhenrykmstf_0-1645425823052.png

 

If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

I am getting an error that .pbix is not supported when attempting to attach the test data. 

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.