Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Counting later records with same values

Hi hopefully someone can point out my mistake,  the below isnt bringing back any resultys where is really should do.

 

I have a jobs table , which I want to show in a table visual with a column to show the number of jobs in the table for each record that have the same propertykeyno , the same problemsummary are recorded after the current row. Any help aprreciated. Thanks

Later Chases = 
var JobID = If(HASONEVALUE('Jobs'[JobNoEventNo]), Min('Jobs'[JobNoEventNo]) ,Blank())
var DateOfJob = If(HASONEVALUE('Jobs'[_RECORDEDDATETIME]), Min('Jobs'[_RECORDEDDATETIME]) ,Blank())
var ProblemSummary = If(HASONEVALUE('Jobs'[PROBLEMSUMMARY]), Min('Jobs'[PROBLEMSUMMARY]) ,Blank())
var PropertyKeyNo = If(HASONEVALUE('Jobs'[PROPERTYKEYNO]), Min('Jobs'[PROPERTYKEYNO]) ,Blank())
var LaterJobs = FILTER('Jobs' , 'Jobs'[_RECORDEDDATETIME] >= DateOfJob && 'Jobs'[PROBLEMSUMMARY] = ProblemSummary && 'Jobs'[PROPERTYKEYNO] = PropertyKeyNo && 'Jobs'[JobNoEventNo] <> JobID)
RETURN
CALCULATE(COUNTROWS(LaterJobs) , ALL(jobs) , LaterJobs)

 

 

3 Replies

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

    Hi Anonymous ,

    Can you please share some sample data and your expected results? Then we will understand clearly and solve it as soon as possible. Please see this post regarding How to Get Your Question Answered Quickly: 

    https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

     

    Best Regards,

    Xue Ding

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

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

    Hi Anonymous ,

    Could you tell me if your problem has been solved? If it is, kindly share your solutions. More people who have the same request will benefit from here. If you are still confused about it, please share same sample data and expected result to us. 

     

    Best Regards,

    Xue Ding

    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 I think actually the above worked for my purposed after all - I am not sure what was affecting the result when I first posted the question.

       

      In what format should I post my sample data in future questions? Thanks?