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
kkanda
Resolver I
Resolver I

Filtering records in Query Editor for Groups

I have a table in Query Editor in the following format:

EquipmentMeasureDate
A12/12/2021
A10/21/2021
B10/7/2020
B12/3/2019
B1/5/2019
C11/23/2019
C2/11/2019
D1/2/2020
D3/21/2019

This  table in Query Editor has the Equipment  grouped and Measure Dates  in descending order.

The requirement is if the latest Measure Date for any Equipment is in the year 2019 or earlier, the entire set of records for that Equipment should be filtered. This will filter the records for Equipment C but not for B or D, where the latest Measure Date is after year 2019, even though some Measure Dates are in 2019. I will appreciate if any of the experts suggest a solution.

Thank you

Krishna

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

Perform a Group By on Equipment with 2 aggregations

Max on measure date     

and [all rows]   (use the Advanced option to see these).

That should give 3 columns.  Use the filter from the column dropdown on the Max Date column.  I think you want 'date > last day of 2019'.

That will leave the rows you want.  Expand the All Rows to return the fields you need.

View solution in original post

2 REPLIES 2
kkanda
Resolver I
Resolver I

Thank you @HotChilli ... this solution worked for me.

HotChilli
Super User
Super User

Perform a Group By on Equipment with 2 aggregations

Max on measure date     

and [all rows]   (use the Advanced option to see these).

That should give 3 columns.  Use the filter from the column dropdown on the Max Date column.  I think you want 'date > last day of 2019'.

That will leave the rows you want.  Expand the All Rows to return the fields you need.

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.