Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Pie chart

Hello,

I have the following table, and the pie cart terget. Can anyone solve my problem ?

 

DeskIdTagIdAreaLabelDeskTagLabel
D303HR areaUniversal docking station
D313HR areaUniversal docking station
D323HR areaUniversal docking station
D333Sales areaUniversal docking station
D343Marketing areaUniversal docking station
D353SalesUniversal docking station
D362Finance AreaStand-up
D364Finance AreaTouchscreen
D371Finance AreaDouble Screen
D381Finance AreaDouble Screen
D393IT areaUniversal docking station
D392IT areaStand-up
D403IT areaUniversal docking station
D402IT areaStand-up
D412Admin AreaStand-up
D413Admin AreaUniversal docking station
D424Finance AreaTouchscreen
D431HR areaDouble Screen
D441IT areaDouble Screen
D471Sales areaDouble Screen
D481Sales areaDouble Screen
D491Sales areaDouble Screen
D501Sales areaDouble Screen
D511Sales areaDouble Screen
D513Sales areaUniversal docking station
D521Sales areaDouble Screen
D523Sales areaUniversal docking station
D532Marketing areaStand-up

 

Target PIE CHart

 

  • Hi, Anonymous 

    Try to create measures:

    _AllDeskID = 
    CALCULATE(COUNT('Table'[DeskId]),ALL('Table'))
    selected = 
    var _isFiltered=ISFILTERED('Table'[DeskTagLabel])
    var _tag=SUMMARIZE(ALLSELECTED('Table'),[DeskTagLabel])
    var _count=CALCULATE(COUNT('Table'[DeskId]),FILTER(ALL('Table'),'Table'[DeskTagLabel] in _tag))
    
    var _if=IF(_isFiltered,_count,0)
    return DIVIDE(_if,[_AllDeskID])
    other = 
    var _isFilterd=ISFILTERED('Table'[DeskTagLabel])
    var _tag=SUMMARIZE(ALLSELECTED('Table'),[DeskTagLabel])
    var _count=CALCULATE(COUNT('Table'[DeskId]),FILTER(ALL('Table'),NOT('Table'[DeskTagLabel] in _tag)))
    
    var _if=IF(_isFilterd,_count,[_AllDeskID])
    return DIVIDE(_if,[_AllDeskID])


    Result:

     

    Please refer to the attachment below for details. Hope this helps.

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng


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

6 Replies

  • Anonymous , You have to create a new column for that

     

    New column = if([DeskTagLabel] in {"Double Screen","Touchscreen"}, "Desk with Touch Screen and Double Screen" , "Other Desks" )

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello Amitchandak
      Thanks for your reply.

      I'm quite new about this. How to achive the chart target with the new column ?
      thanks

  • Hi, Anonymous 

     

    Can you explain how you got the pie chart above?
    I can't seem to get 20% and 80% from your data

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng


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

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi v-angzheng-msft

      Thanks for your reply.

      about the 20 and 80%, it's just example result

      thanks

       
       
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi V-angzheng-msft

      Can you tell me how to create the table  ?
      thanks

      • v-angzheng-msft's avatar
        v-angzheng-msft
        Community Support

        Hi, Anonymous 

        Try to create measures:

        _AllDeskID = 
        CALCULATE(COUNT('Table'[DeskId]),ALL('Table'))
        selected = 
        var _isFiltered=ISFILTERED('Table'[DeskTagLabel])
        var _tag=SUMMARIZE(ALLSELECTED('Table'),[DeskTagLabel])
        var _count=CALCULATE(COUNT('Table'[DeskId]),FILTER(ALL('Table'),'Table'[DeskTagLabel] in _tag))
        
        var _if=IF(_isFiltered,_count,0)
        return DIVIDE(_if,[_AllDeskID])
        other = 
        var _isFilterd=ISFILTERED('Table'[DeskTagLabel])
        var _tag=SUMMARIZE(ALLSELECTED('Table'),[DeskTagLabel])
        var _count=CALCULATE(COUNT('Table'[DeskId]),FILTER(ALL('Table'),NOT('Table'[DeskTagLabel] in _tag)))
        
        var _if=IF(_isFilterd,_count,[_AllDeskID])
        return DIVIDE(_if,[_AllDeskID])


        Result:

         

        Please refer to the attachment below for details. Hope this helps.

         

         

        Best Regards,
        Community Support Team _ Zeon Zheng


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