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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to calculate percentage in Power BI with multiple criteria just like pivot table

Hi guys,

I have a question how to formulate the measure in power BI to create the percentage in visual chart form.

the below criteria is needed:

  1. rejection quantity (TEXT column) divided by input quantity (TEXT column) to get the percentage
  2. when I filter a certain month, the rejection and input will only show the selected months
  3. I think there will be 3 measures need to be formulated to show the result below (line chart)

Expected Result:

- When I selected a range of month, A column chart show part no vs quantity, rejection rate as line, second axis

- When I further selected a part no, the B column chart show month vs quantity, rejection rate as line, (measure 2).

- There is also a supplier vs rejection C column chart, rejection rate as line (measure 3).

- In all condition, the rejection rate remain unchanged if the month filter remain the same

 

DATEPART NUMBERQTYTO LOCATIONCODE SUPPLIERTEXTSERIES
31/3/2023508676XRE1SLSHRINKAGEG
27/3/202345971XRE1WSHRINKAGER
15/3/2023516425XRE1ZSHRINKAGEG
13/3/202315646XRE1PSHRINKAGER
02/3/202315645XRE1PP.HOLEK
24/4/202346737XRE1PP.HOLEj
15/4/202376347XRE1PP.HOLER
31/4/202346739XRE1PP.HOLER
1/4/2023459781XRE1PSHRINKAGEG
8/4/202315642XRE1YP.HOLEG
1/3/202315649000 YINPUTG
1/3/202350865604 PINPUTR
1/4/202345976599 PINPUTR
3 REPLIES 3
devanshi
Helper V
Helper V

abc=

VAR selected=SELECTEDVALUE(Month)

Filter( TableName,Divide(SUM(Part),SUM(Quantity),

TableName,Divide(Month(Date),SUM(Quantity)))

RETURN

   COUNT(Supplier),RejectionRate

v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

You may try a measure like below for rejection rate. Only number type values can do DIVIDE and SUM operations, so ensure to change two quantity columns into whole number or decimal number type in advance. 

Rejection rate = DIVIDE(SUM('Table'[Rejection quantity]),SUM('Table'[Input quantity]))

 

With this condition "- In all condition, the rejection rate remain unchanged if the month filter remain the same", you can try this measure for rejection rate. Only the filter on [Month] column will be kept in the calculation. 

Rejection rate =
DIVIDE (
    CALCULATE (
        SUM ( 'Table'[Rejection quantity] ),
        ALLEXCEPT ( 'Table', 'Table'[Month] )
    ),
    CALCULATE (
        SUM ( 'Table'[Input quantity] ),
        ALLEXCEPT ( 'Table', 'Table'[Month] )
    )
)

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Anonymous
Not applicable

Thank you for the reply but seem like you already misunderstanding the question. I am a newbie in Power BI (just 5 days new). If you don’t mine, would you help to elaborate the method I should use?

Let me further simplify the question.

Let say I have 2 table below.

DATE

PART NUMBER

QTY

CODE SUPPLIER

TEXT

31/3/2023

A

76

SL

SHRINKAGE

27/3/2023

B

1

W

SHRINKAGE

15/3/2023

B

25

Z

SHRINKAGE

13/3/2023

A

6

P

SHRINKAGE

02/4/2023

C

5

P

P.HOLE

24/4/2023

B

7

P

P.HOLE

15/4/2023

C

7

P

P.HOLE

31/4/2023

B

9

P

P.HOLE

 

DATE

PART NUMBER

QTY

CODE SUPPLIER

TEXT

1/3/2023

A

1000

P

INPUT

1/3/2023

A

1000

P

INPUT

8/3/2023

B

2000

Y

INPUT

1/4/2023

A

9000

Y

INPUT

1/4/2023

B

5000

P

INPUT

1/4/2023

C

6000

P

INPUT

 

How can I link these 2 tables (need to use relationship?) so that I can use the below measure to make it work perfectly.

Rejection rate = DIVIDE(SUM('Table 1'[QTY]), SUM('Table 2'[QTY]))

When I filter certain period, the chart will show the rejection rate of that period but not always divide all the input in table 2

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors