Forum Discussion

e175429's avatar
e175429
Helper IV
9 months ago
Solved

Data Label on Graph

Hey all,

 

I am able to get my graph to show EITHER whole numbers OR %. Is there a way to get both shown on the same graph?

 

Thank you!

  • Ok, that's fine. You will need to create some measures- similar to the following- use whatever your actual table and field names are.

     

    Count of Name = COUNT(Names[Name])
    Count of All Names = COUNTROWS(ALL(Names))
    Percent of Total Names = DIVIDE([Count of Name],[Count of All Names],0)
     
    Then put Percent of Total Names into Data under Detail on the Data Labels section of the visual settings.
     
    I've updated the .pbix file.

     

8 Replies

  • Hi e175429 ,

     Please see the attached .pbix file. You can do this by creating an additional measure and putting it in the Detail section of Data Labels on your visual. Please let me know if you have any questions about this approach.

     

    • e175429's avatar
      e175429
      Helper IV

      So, i don't have a number column like your sales column, I just have a column of user names like this:

       

      And to create the graph I just put the user name colum on the x and y axis to see how many each user did:

       

      So I can't sum a column of names.

       

      • djurecic's avatar
        djurecic
        Super User

        Ok, that's fine. You will need to create some measures- similar to the following- use whatever your actual table and field names are.

         

        Count of Name = COUNT(Names[Name])
        Count of All Names = COUNTROWS(ALL(Names))
        Percent of Total Names = DIVIDE([Count of Name],[Count of All Names],0)
         
        Then put Percent of Total Names into Data under Detail on the Data Labels section of the visual settings.
         
        I've updated the .pbix file.

         

  • Hi, you may use this DAX sample from my report. 

    Request Count & % of Total = 
    VAR CurrentCount = COUNT('table'[Request ID])
    VAR TotalCount = CALCULATE(
        COUNT('table'[Request ID]),
        ALLSELECTED()     --Adjust your filter modifier accordingly 
    )
    VAR Percentage = DIVIDE(CurrentCount, TotalCount, 0)
    RETURN
    CurrentCount & " (" & FORMAT(Percentage, "0.0%") & ")"

    and add it in