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
MarkShu
Helper I
Helper I

Power Query relative filter for dates (months)

Hello! 

Do you know the way to filter out the last 2 months (relative) in Power Query? 

1 ACCEPTED SOLUTION
MarkShu
Helper I
Helper I

Eventually I did this with DAX: 
Clients = CALCULATE(COUNTA('Outflow'[ID]);FILTER('Outflow;'Outflow'[Date]<DATE(YEAR(today());MONTH(today())-1;1)))

View solution in original post

2 REPLIES 2
MarkShu
Helper I
Helper I

Eventually I did this with DAX: 
Clients = CALCULATE(COUNTA('Outflow'[ID]);FILTER('Outflow;'Outflow'[Date]<DATE(YEAR(today());MONTH(today())-1;1)))

v-shex-msft
Community Support
Community Support

Hi @MarkShu,

 

>>Do you know the way to filter out the last 2 months (relative) in Power Query? 

Normal filter not support this, I think you need to do some customize on fitler formula.

 

Add a filter on date column and use bold part to replace original date value:

#"Filtered Rows" = Table.SelectRows(#"Previous Steps", each [DATE] >= Date.AddMonths(List.Max(#"Previous Steps"[DATE]),-2))

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.