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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

% Percentage by day and category in a matrix and in a line chart

Hi, since multiples days I'm trying to create a percentage column in my Power BI project but I can't find any matching situation on the internet that could help me.

 

So, as you can see in the first table, I have a row "closed",

in the second table, the number of "closed" that were rejected,

and in the last one the number of "closed" - "closed rejected"

 

And I want to display the percentage of the last one compared to the total of the first one. In a table and in a line chart. So I think I need a new "DAX calculated" column in my data. (I don't know if I'm clear Smiley Very Happy )

 

Screen Shot 09-16-19 at 11.09 AM.PNGScreen Shot 09-16-19 at 11.29 AM.PNG

I need to get the percentage of State= "closed" that are not Closing reason = "Rejected" by day (Compared to the total number of state each day)

Thanks!

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

You can create your measures like so:

Count = COUNTROWS('Table')
Percentage of Closed =
DIVIDE (
    CALCULATE (
        [Count],
        ALLEXCEPT ( 'Table', 'Table'[Date] ),
        'Table'[State] = "Closed",
        'Table'[Closing Reason] <> "Rejected"
    ),
    CALCULATE ( [Count], ALLEXCEPT ( 'Table', 'Table'[Date] ) )
) + 0

closed1.PNGclosed2.PNG

Best Regards,

Icey

 

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

2 REPLIES 2
Icey
Community Support
Community Support

Hi @Anonymous ,

You can create your measures like so:

Count = COUNTROWS('Table')
Percentage of Closed =
DIVIDE (
    CALCULATE (
        [Count],
        ALLEXCEPT ( 'Table', 'Table'[Date] ),
        'Table'[State] = "Closed",
        'Table'[Closing Reason] <> "Rejected"
    ),
    CALCULATE ( [Count], ALLEXCEPT ( 'Table', 'Table'[Date] ) )
) + 0

closed1.PNGclosed2.PNG

Best Regards,

Icey

 

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

 

Anonymous
Not applicable

I'm sorry, just saw your solution, my problem is gone ! Thank you for your answer

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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