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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Jacekk111
Helper I
Helper I

Calculate percentage of category excluding some value from denominator

Greetings Community.

I'm looking for a solution to calculate % by category. However I have constraints that I must subtract from denominator one of category for all. 

I'm dividing Pomiar1/Pomiar2

 

Pomiar1 = SUM(Zbiorcza[crfea_czas])
Pomiar2 = SUM('Open Time'[CzasOpen])-CALCULATE(SUM(Zbiorcza[crfea_czas]),Zbiorcza[crfea_rodzajstraty]="No Production/ Brak Produkcji")
My problem is that time "No Production" is not substract for each category in Pomiar2 (2880 should - 1467 for each) but only for categor "No Production/ Brak Produkcji") and wrong % is calculated at the end. Any ideas how to improve?

Jacekk111_1-1666958602163.png

 

 

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @Jacekk111 

Try to modify 'Pomiar2' formula like:

 

Pomiar2 =
SUM ( 'Open Time'[CzasOpen] )
    - CALCULATE (
        SUM ( Zbiorcza[crfea_czas] ),
        FILTER (
            ALL ( Zbiorcza ),
            Zbiorcza[crfea_rodzajstraty] = "No Production/ Brak Produkcji"
        )
    )
QE_Kategorie=Pomilar1/Pomiar2

If it doesn't work, please share a sample pbix for further research.

 

Best Regards,
Community Support Team _ Eason

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-easonf-msft
Community Support
Community Support

Hi, @Jacekk111 

Try to modify 'Pomiar2' formula like:

 

Pomiar2 =
SUM ( 'Open Time'[CzasOpen] )
    - CALCULATE (
        SUM ( Zbiorcza[crfea_czas] ),
        FILTER (
            ALL ( Zbiorcza ),
            Zbiorcza[crfea_rodzajstraty] = "No Production/ Brak Produkcji"
        )
    )
QE_Kategorie=Pomilar1/Pomiar2

If it doesn't work, please share a sample pbix for further research.

 

Best Regards,
Community Support Team _ Eason

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 MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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