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
Anonymous
Not applicable

Calculate Subcategory Totals. Then divide all Subcategories by sum otwo specific subcategory totals.

I could not find my specific issue in an existing post. Any help will be appreaciated. 

 

I have a the table below (table1). This table references Jobcodes in (table2) 

Table 1

JobcodeFTE's
16
27.06
331.04
423
514

 

Table2

JobcodeSubcatCat
1APPProvider
2OpsSupport Staff
3ClinicalSupport Staff
4ClericalSupport Staff
5PhysicianProvider

 

 

I am able to to get the following, but need to divide everything by the Provider total of 20.

Provider20
Physician14
APP6
Support Staff61.1
Ops7.06
Clinical31.04
Clerical23
Total81.1

 

This is what I really need.

Provider1
Physician0.7
APP0.3
Support Staff3.055
Ops0.353
Clinical1.552
Clerical1.15

 

This is the formula that gets me closest to what I need. 

Provider Ratio = DIVIDE(Table1[FTE's],CALCULATE(SUM(Table1[FTE's]),OR('Table2'[Subcat]="APP",'Table2'[Subcat]="Physician")))

Provider1
Physician0.7
APP0.3
Total4.055

I do not understand why it is filtering out my other subcategories/cat totals.

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @Anonymous 

Your current formula does what Provider Total2 does in the screenshot below

danextian_0-1657587952001.png

That is because the filter is removed in Subcat but no Cat. Since both APP and Physicial are under Provider, Support Staff will then return blank. Your formula is very similar to this:

Provider Total2 =
CALCULATE (
    SUM ( fte[FTE's] ),
    FILTER (
        ALL ( jobcode[Subcat] ),
        jobcode[Subcat] = "Physician"
            || jobcode[Subcat] = "APP"
    )
)

Change your formula to this:

Provider Total = 
CALCULATE (
    SUM ( fte[FTE's] ),
    FILTER (
        ALL ( jobcode[Cat], jobcode[Subcat] ),
        jobcode[Subcat] = "Physician"
            || jobcode[Subcat] = "APP"
    )
)









Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@danextian 

 

THANK YOU!!!!! You are appreciated!

 

The answer seeems so obvious now... 

danextian
Super User
Super User

Hi @Anonymous 

Your current formula does what Provider Total2 does in the screenshot below

danextian_0-1657587952001.png

That is because the filter is removed in Subcat but no Cat. Since both APP and Physicial are under Provider, Support Staff will then return blank. Your formula is very similar to this:

Provider Total2 =
CALCULATE (
    SUM ( fte[FTE's] ),
    FILTER (
        ALL ( jobcode[Subcat] ),
        jobcode[Subcat] = "Physician"
            || jobcode[Subcat] = "APP"
    )
)

Change your formula to this:

Provider Total = 
CALCULATE (
    SUM ( fte[FTE's] ),
    FILTER (
        ALL ( jobcode[Cat], jobcode[Subcat] ),
        jobcode[Subcat] = "Physician"
            || jobcode[Subcat] = "APP"
    )
)









Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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.