Forum Discussion

ShejalTiwari's avatar
ShejalTiwari
Frequent Visitor
1 year ago
Solved

Percent of Subtotal is Incorrect When Headcount Changed Dynamically using Parameters

Datasource   Task.xlsx file is the data Source which contains data including Group, Function, Country, and Headcount. .pbix file  - https://drive.google.com/file/d/1mhLFS0-BvzScHx-O5FUIqMRZG_ehCqg...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi ShejalTiwari ,

     

    Please create a measure as follows:

     

     

    Measure 2 = 
    VAR _a = SELECTEDVALUE(Sheet1[Group])
    VAR _table = SUMMARIZE(ALL(Sheet1),'Sheet1'[Group],'Sheet1'[Function],'Sheet1'[Country],"Test",[Headcount New])
    RETURN
    IF(
        HASONEVALUE(Sheet1[Group]),
        DIVIDE([Headcount New], SUMX(FILTER(_table, 'Sheet1'[Group] = _a), [Test])),
        SUMX(SUMMARIZE(Sheet1,Sheet1[Group],"Measure", DIVIDE([Headcount New], SUMX(FILTER(_table, 'Sheet1'[Group] = MAX(Sheet1[Group])), [Test]))),[Measure])
    )

     

     

    The result is as follows:

     

    Best Regards,
    Zhu
    Community Support Team

     

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