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.
My question is, is there a way to get the first/earliest date per grouping in a table and then filter the table to only include rows within the first x number of months of that first date, per grouping. Probably easiest to ask with example. Say I have the following table, and want to keep data for first 6 months of each Group:
The resulting table would look like:
Is there a way to do this using DAX/M?
Solved! Go to Solution.
Hello @Anonymous
try like this:
FILTER( 'Table', EDATE( [Date], -6 ) <= CALCULATE( MIN( 'Table'[Date] ), ALLEXCEPT( 'Table', 'Table'[Group] ) ) )
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Hello @Anonymous
try like this:
FILTER( 'Table', EDATE( [Date], -6 ) <= CALCULATE( MIN( 'Table'[Date] ), ALLEXCEPT( 'Table', 'Table'[Group] ) ) )
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
@LivioLanzothanks for your response. Where would I actually enter this code? Can you possibly provide PBIX file example?
@Anonymous
It is a DAX query which returns a table so you'd go to the 'Modeling' tab and click on 'New Table'
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |