Forum Discussion

KVPBI1's avatar
KVPBI1
New Member
4 years ago
Solved

Formula to return a count for given criteria

I have a dataset that includes multiple IDs and expiration buckets. Each ID should only have one count per bucket.

 

Dataset 
IDExpired
130
10
130
260
290
330
330
330

 

Expected Result
ExpiredCount
302
601
901

 

Thanks!

  • KVPBI1 , Use a measure

     

    Distinctcount(Table[ID]) in a visual with Expired

     

    or calculate(Distinctcount(Table[ID]), filter(Table, table[Expired] <>0 ))

2 Replies

  • KVPBI1 , Use a measure

     

    Distinctcount(Table[ID]) in a visual with Expired

     

    or calculate(Distinctcount(Table[ID]), filter(Table, table[Expired] <>0 ))

  • v-chenwuz-msft's avatar
    v-chenwuz-msft
    Icon for Community Support rankCommunity Support

    Hi KVPBI1 ,

     

    Or you can use the functions provided by power bi to achieve the results you want. Please refer to the gif below.

    Best Regards

    Community Support Team _ chenwu zhu

     

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