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

Calculate % of reports disposed for each category based on quantity of another column from model

I have 3 columns in my data model:
* Location (string)
* Disposition Category/Time Frame (string)
* Quanity of reports (numeric)

I am trying to calculate the percentage of reports that are disposed within each time frame for each location. I have the number of reports for each category for each location (see attached matrix), but I am having trouble writing the Dax expression to calculate the disposition percentage because I need to omit specific disposition categories, and I am using the numeric value from a different column. The formula I am trying to replicate is below. Thank you! CA example.jpg

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thank you, @Icey

 

Yes, that is what my table looks like. I tried the both of the measures you sent, and I am not getting the same percentages. I have attached the below screenshot to show my updated matrix. Any help is greatly appreciated. Thank you!! 

 

Marie 

 

CA example2.jpg

View solution in original post

4 REPLIES 4
Icey
Community Support
Community Support

Hi @Anonymous ,

Is this your table like?

calculate.PNG

If so, you can create your measures like so:

percent A =
IF (
    CALCULATE (
        SUM ( 'Table'[Quanity of reports] ),
        'Table'[Disposition Category/Time Frame] <> "Pending From 155 to 301 days"
    ) > 9,
    DIVIDE (
        CALCULATE (
            SUM ( 'Table'[Quanity of reports] ),
            'Table'[Disposition Category/Time Frame] = "Dispoesd Afer 301 days"
        ),
        CALCULATE (
            SUM ( 'Table'[Quanity of reports] ),
            'Table'[Disposition Category/Time Frame] <> "Pending From 155 to 301 days"
        )
    )
)

Or,

Measure =
IF (
    CALCULATE (
        SUM ( 'Table'[Quanity of reports] ),
        'Table'[Disposition Category/Time Frame] <> "Pending From 155 to 301 days"
    ) > 9,
    DIVIDE (
        SUMX (
            FILTER (
                'Table',
                'Table'[Disposition Category/Time Frame] <> "Pending From 155 to 301 days"
            ),
            'Table'[Quanity of reports]
        ),
        CALCULATE (
            SUM ( 'Table'[Quanity of reports] ),
            'Table'[Disposition Category/Time Frame] <> "Pending From 155 to 301 days"
        )
    )
)

calculate2.PNG

 

If I have any misunderstandings, please let me know.

 

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

Thank you, @Icey

 

Yes, that is what my table looks like. I tried the both of the measures you sent, and I am not getting the same percentages. I have attached the below screenshot to show my updated matrix. Any help is greatly appreciated. Thank you!! 

 

Marie 

 

CA example2.jpg

Icey
Community Support
Community Support

Hi @Anonymous ,

 

This is my PBIX file.

 

Best Regards,

Icey

Anonymous
Not applicable

Thank you so much!! I got it to work! 

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.