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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Nested measures: issue when same column filtered

Morning everyone,

 

I have experienced this issue previously and have finally decided to ask about it, just in case there is a solution for it.

When I create metrics from previous metrics, and try to add a filter using a previously filtered column, the filter does not work. 

 

I'll put an example:

Total surveys = DISTINCTCOUNT(Test[SurveyID])

Total surveys_Q6 = CALCULATE('Total surveys', Test[Q6] <> BLANK())

Total surveys_Q6_excellent = CALCULATE('Total surveys_Q6 ', Test[Q6] = 10)

 

SurveyIdQ3Q6

1

6 
287
3107
4  
559
61 
7310
801
990

 

So, the first 2 metrics are OK. I am simply seeing the total number of surveys we have, and which of those have an answer for question 6. However, when I want to see how many surveys got an excellent score for Q6, the filter is not working (because I previously used it to calculate those that were not blank).

 

I've tried using ALL, REMOVEFILTERS, etc. And nothing works. At the end, I always end up duplicating a column, or copying the whole formula again (in this case, copying would not be a massive issue, but it is with more complicated metrics).

 

So, has anyone managed to solve this? What is your workaround? It's a really annoying issue and I can't believe it has not been fixed by microsoft yet.

 

Thanks in advance!

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please Add Filter() function to the formula.

Total surveys_Q6_excellent = CALCULATE([Total surveys_Q6], FILTER(test, Test[Q6] = 10))

Capture.PNG

Tips: Using either the operator == or the ISBLANK function to distinguish 0 and blank.

 

Best Regards,

Jay

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

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please Add Filter() function to the formula.

Total surveys_Q6_excellent = CALCULATE([Total surveys_Q6], FILTER(test, Test[Q6] = 10))

Capture.PNG

Tips: Using either the operator == or the ISBLANK function to distinguish 0 and blank.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
speedramps
Super User
Super User

Please consider this solution
Total surveys_Q6_excellent =
CALCULATE([Total surveys], Test[Q6] = 10)
 

Remember we are BI community voluntrees so please click the thumbs-up for me taking the trouble to help you and then accept the solution if it works.  Thank you !

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.