Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
RonaldMussche
Frequent Visitor

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.

 Table.PNG

 

 

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 3
v-piga-msft
Resident Rockstar
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.

 

measure.PNG

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

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Cherry,

 

Can you take a look at this? Still waiting for a solution. Otherwise we will rewrite this in calculated columns but this sould work I think.

 

Regards

Ronald

Thank you for your reply. It will go wrong with the ranking as a measure.

 

Here you can download the pbi file.

https://1drv.ms/u/s!Avw2v5UjMP5vgbIuDjy8DuShcyTRbA

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.