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 ?   DeskId TagId AreaLabel DeskTagLabel D30 3 HR area Universal docking station D31 3 HR ar...
  • v-angzheng-msft's avatar
    v-angzheng-msft
    4 years ago

    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.