Forum Discussion

RonaldMussche's avatar
RonaldMussche
Frequent Visitor
7 years ago

Using measures in a filter

Hi,

 

I'm stuggeling with measures. I have scores for every person in a trimester. I want to know how many times a persons scores above 20 points in the last 4 trimesters. In some reason I'm not able to manage this in measures. In calulated columns it works fine.

 

 

 

the first 3 column is raw data.

 

M RankTimeSlot = RANKX( ALL(TempData[TimeSlot]), CALCULATE( MAX(TempData[TimeSlot])))

This funtion works fine and in some magical way he know that I want to partition by Person.

 

Than I want to count how many Score are above 20 in the last 4 trimesters Score >= 20 && M RankTimeSlot < =4

M Less Then 4 = CALCULATE(COUNT(TempData[Timeslot]),FILTER(TempData,[M Threshold Growth] <= 4 && TempData[Score] >=20))

 

But the Filter on the measure does not seems to work. The Score works fine.

 

Hope someone can help me with this.

3 Replies

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi RonaldMussche,


     Than I want to count how many Score are above 20 in the last 4 trimesters Score >= 20 && M RankTimeSlot < =4

    M Less Then 4 = CALCULATE(COUNT(TempData[Timeslot]),FILTER(TempData,[M Threshold Growth] <= 4 && TempData[Score] >=20))

     

    But the Filter on the measure does not seems to work. The Score works fine.

     


    By my tests, the measure should work as expected. I'm afraid the issue may caused by the measure for Rankx.

     

    Here is the result for my test with your measure M Less Then 4, but my 'TempData'[M] is the raw data not calculated by dax.

     

    If I create the measure M RankTimeSlot with your formula, I cannot get the same result as yours.

     

    If it is conveniten, could you share a dummy pbix file which can reproduce the scenario, so that we can help further investigate on it? You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.)

     

    Best Regards,

    Cherry