Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I have a calculated column of days an event is going on. The list is anything between 0 to 200. I want to aggregate that to groups like 0-5 Days, 6-10 Days, 11-30 Days, 31-60 Days, 61-90 Days and Over 90 Days. So anything between 0 and 5 would get the group 0-5 Days, etc. I want to use that to calculate how many events are taking longer than 0-5 Days for example:
Example of the visual I'l trying to create: https://ibb.co/XjKqLZp
Thank you in advance,
Frank
Solved! Go to Solution.
@Anonymous
you can create a column.
day group = SWITCH(TRUE(),'Table (2)'[day]<=5,"0-5days",'Table (2)'[day]<=10,"6-10days",'Table (2)'[day]<=30,"11-30days",'Table (2)'[day]<=60,"31-60days",'Table (2)'[day]<=90,"61-90 days",">90days")
Then create a measure
count = COUNTX(FILTER('Table (2)','Table (2)'[day group]="0-5days"),'Table (2)'[day])
Proud to be a Super User!
@Anonymous
you can create a column.
day group = SWITCH(TRUE(),'Table (2)'[day]<=5,"0-5days",'Table (2)'[day]<=10,"6-10days",'Table (2)'[day]<=30,"11-30days",'Table (2)'[day]<=60,"31-60days",'Table (2)'[day]<=90,"61-90 days",">90days")
Then create a measure
count = COUNTX(FILTER('Table (2)','Table (2)'[day group]="0-5days"),'Table (2)'[day])
Proud to be a Super User!
This worked after I added a space between the condition and the value <=5 , "0-5 Days" ....
Thank you for the suggestion. I tried im getting this error: Unexpected expression '"0-5days"'. (I changed the table and column name to the correct)
Hi @Anonymous ,
Please share some screenshots or a dummy .pbix file, so we can help you find the cause of the problem. Please remove sensitive information.
Best Regards,
Icey
User | Count |
---|---|
84 | |
74 | |
63 | |
51 | |
45 |
User | Count |
---|---|
101 | |
43 | |
41 | |
39 | |
36 |