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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
okusai3000
Helper IV
Helper IV

Filter a Measure with another Measure

Hello everyone,

 

I've spent the last 2 hours trying to find an answer but I couldn't find it.

 

The request is simple: I need to count only those Items with "Antiguedad" less than 180.

 

I tried many iterations from CALCULATE(DISTINCTCOUNT(ID);FILTER('FACT EQUIPOS';[ANTIGUEDAD]<-180) but it doesn't work

 

Any ideas? thanks!

Captura de pantalla 2020-09-18 a las 20.06.08.png

 

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

What does your raw data look like and where are you trying to use this filter/measure?

If you look at your Fact table, is there more than one row per Marca? Your measure will first calculate the Antiguedad for each row in your Fact Equipos table, and if the Antiguedad <-180 for that specific row, then the ID will be counted (though I'm not sure which table that ID is in? Your measure seems to have some syntax errors). If Antiguedad is a grouped measure by Marca, then you may need to put your FILTER(VALUES(Marca), [Antiguedad]<-180) and see if that gives the result you expect.

If not, please provide more info about your input data and show the current result you have achieved so far.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

3 REPLIES 3
AllisonKennedy
Super User
Super User

What does your raw data look like and where are you trying to use this filter/measure?

If you look at your Fact table, is there more than one row per Marca? Your measure will first calculate the Antiguedad for each row in your Fact Equipos table, and if the Antiguedad <-180 for that specific row, then the ID will be counted (though I'm not sure which table that ID is in? Your measure seems to have some syntax errors). If Antiguedad is a grouped measure by Marca, then you may need to put your FILTER(VALUES(Marca), [Antiguedad]<-180) and see if that gives the result you expect.

If not, please provide more info about your input data and show the current result you have achieved so far.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Hi @AllisonKennedy ,

 

I have been searching for weeks. 

I even posted on the forum.

I tried with summarize, it worked but itslowed down the performance of the report.

 

and viola! 

your solution worked like a charm.

 

Thanks for sharing this!

Awesome Allison! Your solution was super accurate and it worked. Thank you!!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors