Forum Discussion

cmaier's avatar
cmaier
Advocate I
2 years ago

Trouble with Legend Values

I am very new to PowerBI but thought I had a decent understanding. I am having trouble with one of my legends.  I have successfully created a measure that shows average hours/week in particular category. However, when I add a field to the legend, it RE-iterates the average function based on the week counts for the subcategories as opposed to overall week count. 

 

For example it would show me a total in the subcategory divided by the count of week in which that subcategory was logged, as opposed to divided by all weeks the employee worked.

 

Sorry if that didn't make sense. I've been staring at this all day and my brain is a little fried

2 Replies

  • cmaier , Try like

     

    calculate(Distinctcount(Table[Week]), removefilters(Table[Category], Table[Sub Category]))

     

    Power BI Percent of Total and Percent of SubTotal: https://www.youtube.com/watch?v=cN8AO3_vmlY&t=24270s

     

    Or this can help

    How to Switch Subtotal and Grand Total in Power BI | Power BI Tutorials| isinscope: https://youtu.be/smhIPw3OkKA

     

     

    If this does not help
    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

    • cmaier's avatar
      cmaier
      Advocate I

      I will try these and get back to you. I don't know if it will work, but at least it's something I can move forward on.  Thank you.