The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello All,
I want to filter data with last 15 months of data from max date
Please help
Thanks!
Solved! Go to Solution.
@Anonymous You can create a new Custom Column in Power Query to present months difference from Max Date Month by using the following Power Query Formula
Date.Month([Date]) - Date.Month(List.Max(#"Sorted Rows"[Date])) +
(Date.Year([Date]) - Date.Year(List.Max(#"Sorted Rows"[Date]))) * 12
Then apply a Filter on new column where months difference is greater than -15, so that only last 15 months data should be availble to use.
Regards,
Fahad Qadir
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
@Anonymous You can create a new Custom Column in Power Query to present months difference from Max Date Month by using the following Power Query Formula
Date.Month([Date]) - Date.Month(List.Max(#"Sorted Rows"[Date])) +
(Date.Year([Date]) - Date.Year(List.Max(#"Sorted Rows"[Date]))) * 12
Then apply a Filter on new column where months difference is greater than -15, so that only last 15 months data should be availble to use.
Regards,
Fahad Qadir
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
Are you meaning the last 15 calendar months? Or are you meaning (15months)*(~30days/month) = ~450 days?
Are you wanting this as a DAX measure or a visual-level filter or a page-level filter or a report-level filter? Are you wanting to screen out data older than 15 months at the import level using Power Query?
When you say "max date" are you referring to a date selected in a slicer, or are you referring to today's date (whatever that happens to be), or are you referring to the latest date found in a certain table?
More information about the exact problem you're trying to solve is going to help us answer your question. As much as you can provide.
///Mediocre Power BI Advice, but it's free///
User | Count |
---|---|
68 | |
63 | |
59 | |
54 | |
28 |
User | Count |
---|---|
183 | |
80 | |
62 | |
46 | |
38 |