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.
Hi All,
Is there a way of being able to categorise my data into certain months for example, I have data that I want to be able to categorise into 0-12 months and 25-48 months and anything else would be "Other", what would be the quickest way of doing this?
Current Date | 30/09/2019 |
Date | Category |
01/12/2002 | Other |
01/09/2019 | 0-24 |
22/05/2018 | 25-48 |
13/07/2005 | Other |
01/12/2018 | 0-24 |
01/01/2019 | 0-24 |
01/04/2019 | 0-24 |
05/05/2018 | 25-48 |
Solved! Go to Solution.
@UK_User123456 Please add a new column as below
Category = VAR _MonthsDiff = DATEDIFF([Date],TODAY(),MONTH) RETURN IF(_MonthsDiff<=24,"0 -24",IF(_MonthsDiff<=48,"25 - 48","Other"))
Added MonthsDiff column, just for reference.
Proud to be a PBI Community Champion
Hi @UK_User123456 ,
You can also use M query to do it. Here is my test file, you could download and refer to it.
Hi,
I cannot see how you have created the workings as it wont let me update power bi? Are you able to post the working?
Thank you.
Hi @UK_User123456 ,
You could open query editor and find "APPLIED STEPS" in the right part. It shows each step to get the final result.
@UK_User123456 Please add a new column as below
Category = VAR _MonthsDiff = DATEDIFF([Date],TODAY(),MONTH) RETURN IF(_MonthsDiff<=24,"0 -24",IF(_MonthsDiff<=48,"25 - 48","Other"))
Added MonthsDiff column, just for reference.
Proud to be a PBI Community Champion
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 |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |