Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Formula not displaying on granular level

My formular below works on total level but does not work on granular level. 
I think the issue is under Class there is Headcount. 

CPH Actual = iferror(CALCULATE([Actual],Account[Sub Class]="People")/CALCULATE([Avg. Actual People]),0)


3 Replies

  • Hi Anonymous 

    Try this:

    CPH Actual =
    VAR _A =
        CALCULATE ( [Actual], KEEPFILTERS ( Account[Sub Class] = "People" ) ) / [Avg. Actual People]
    RETURN
        IFERROR ( _A, 0 )
    

     

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

    Appreciate your Kudos!! 

    LinkedIn | Twitter | Blog | YouTube 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous  ,

    You can create another new measure as below and put this new measure to replace the original measure onto the measure visual as below screenshot...

    Note: The groupby fields are from the fields marked with red lines in the screenshot below...

    New measure =
    SUMX (
        GROUPBY (
            Account,
            Account[Class],
            Account[Sub Class],
            Account[fieldname1],
            Account[fieldname2]
        ),
        [CPH Actual]
    )

     

    In addition, you can refer the following links to try to solve your problem...

    Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

    Dax for Power BI: Fixing Incorrect Measure Totals

     

    If the above one can't help you get the desired result, please provide some sample data in your table Account (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community

    Best Regards

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Anonymous ,

    Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.

    Best Regards