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

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

Reply
rconcil
Frequent Visitor

Percentage calculation issue when using calculation group

Hello the community,


I have an percentage calculation issue when I try to change from absolute values to percentage values.
I used calculation group to be able to implement the switch between absolute values and percentage values.
And I think my percentage calculation is not correct in the relative calculation item, but I don't know how to fix it.


PBIX file:

Link to file: https://drive.google.com/file/d/19fffevBDRew8yCj7A5p7iIrXbfJW8vNR/view?usp=share_link

 

Problem explanation:

1. Absolute values with applied filter on company.

2023-04-13 21_09_54-Demo Report - Power BI Desktop.png
2. Now I switch the values to percentage.

2023-04-13 21_12_31-Demo Report - Power BI Desktop.png

ISSUE & EXPECTED VALUES: 
The percentage result shows 1% for female and male when I am expecting to have 50% female and 50% male.
The percentage result shows 1% for Full time when I am expecting to have 100% for full time.

 

How did I implemented the solution

  1. I created a custom measure custom-Employee-Count in my FACTHEADCOUNTCONTRACT table, that count the active employees other the years.
    2023-04-13 21_22_28-Demo Report - Power BI Desktop.png
  2. My table FACTHEADCOUNTCONTRACT is linked to my EMPLOYEES table with the EMPLOYEEKEY field.
  3. I used tabular editor to create the switch between absolute and percentage values:
    Absolute calculationAbsolute calculationPercentage calculationPercentage calculation

I think the issue is on my percentage calculation in the percentage calculation item when I remove the filters.

 

IF (
    ISSELECTEDMEASURE ( [custom-Employee-Count] ),
    VAR Percentage = DIVIDE(
            SELECTEDMEASURE(),
            CALCULATE(
                SELECTEDMEASURE(),
                REMOVEFILTERS()
            )
        )
    RETURN 
        ROUNDUP(Percentage,2)
)

 

 
I highly appreciate you help 🤝

1 ACCEPTED SOLUTION

Instead of REMOVEFILTERS() I would use ALLSELECTED()

 

Did you know there is a new formatting function for measures available?  That might remove the need for Tabular Editor.  Measures in Power BI Desktop - Power BI | Microsoft Learn

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Hello @lbendlin following your suggestion, I have:

  • Added the PBIX demo file
  • Change the title where I explain the expected value, please see section "ISSUE & EXPECTED VALUES:".

Let me know if something else could be improved in my post.

Kind Regards,

Instead of REMOVEFILTERS() I would use ALLSELECTED()

 

Did you know there is a new formatting function for measures available?  That might remove the need for Tabular Editor.  Measures in Power BI Desktop - Power BI | Microsoft Learn

Thanks a lot for the help, indeed replacing REMOVEFILTERS() with ALLSELECTED() did the trick 👍

Also big thanks for sending me the documention to the Dynamic format strings feature, I was not aware of it. I will have a look into it, indeed if I can replace Tabular Editor with this feature that would be the best solution.

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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 Kudoed Authors