Forum Discussion

djheathy's avatar
djheathy
Helper I
6 years ago
Solved

Selecting single value from multiple rows

I've created an example to illustrate the challenge that I'm facing, but basically, I want to show active subscribers over time (I'm ok with this bit) and total subscription value. However, I only wa...
  • v-deddai1-msft's avatar
    v-deddai1-msft
    6 years ago

    Hi djheathy,

     

    According to your needs, I created the following content for your reference, I hope it can help you:

     

    1. Create a table for determining the level of service by using value 1,2,3:

    1. Create a column for calculating the value of the highest level of service (active subscriber)subscribed by the current subscriber:

     

    Column = CALCULATE(MAX(Service[Column1]), FILTER(ALL(Subscriber), Subscriber[Subscriber] = EARLIER(Subscriber[Subscriber])&&Subscriber[to] = BLANK()))

     

    3.Create a column for calculating Whether the level of the current service is higher than the highest level of service subscribed by the current subscriber, if it is return 1, otherwise return 0:

     

    Column 2 = IF(Subscriber[Column] = BLANK(),0,IF(RELATED(Service[Column1])<Subscriber[Column],0,1))

     

    4. Create a measure for calculate active subscriber for each service:

     

    Measure = var a = CALCULATE(COUNTROWS(Subscriber),Subscriber[Column 2] = 1) return IF(a = 0,0,a)

     

     

     

    Please refer to the pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EXxfieGQruBAn6Sq8bokdkIB4LsIjZJoXwFwQOqPbA9z9g?e=rHndI1

     

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

     

    Best Regards,

    Dedmon