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

Percentage by PO Number

Hi all,

 

I want to calculate percentage of qty per PO Number (example below so by PO1 and PO2).

 

2021-10-21_22-24-28.jpg

 

I want to use percentage to be dynamically calculated (but always by PO Number) if I am using Plant or Material in Rows for Matrix/Table/Charts. 

 

Thanks in advance

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @mb0307 

 

Try this measure:

Percentage by PO Number =
VAR _Qty =
    MAX ( 'Table'[Qty] )
VAR _TotalQtyPO =
    CALCULATE ( SUM ( 'Table'[Qty] ), ALLEXCEPT ( 'Table', 'Table'[PO Number] ) )
RETURN
    _Qty / _TotalQtyPO

 

Output:

 

VahidDM_0-1634853416371.png

 

 

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

Appreciate your Kudos!!

 

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @mb0307 

You can try the following methods.

1. Create a new calculation column to calculate the percentage.

Percentage by PO Number =
[Qty]
    / CALCULATE (
        SUM ( 'Table'[Qty] ),
        FILTER ( 'Table', 'Table'[PO Number] = EARLIER ( 'Table'[PO Number] ) )
    )

vzhangti_0-1635140003314.png

2. Change decimal format to percentage format.

vzhangti_1-1635140051693.jpeg

3.The results in Matrix and Table Charts are shown in the figure.

vzhangti_2-1635140109870.jpegvzhangti_3-1635140118621.png

If the method I provided above can't solve your problem, what's your expected result? Could you please provide more details for it?

Best Regards,

Charlotte Zhang

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

 

Kevin_Harper
Helper I
Helper I

Can you add what results you are expecting to see based on the information in your table above if you were to manually calculate the answer?

Are you looking for a 5th column to show these results? 

VahidDM
Super User
Super User

Hi @mb0307 

 

Try this measure:

Percentage by PO Number =
VAR _Qty =
    MAX ( 'Table'[Qty] )
VAR _TotalQtyPO =
    CALCULATE ( SUM ( 'Table'[Qty] ), ALLEXCEPT ( 'Table', 'Table'[PO Number] ) )
RETURN
    _Qty / _TotalQtyPO

 

Output:

 

VahidDM_0-1634853416371.png

 

 

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

Appreciate your Kudos!!

 

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.