Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi, I have a set of data which i have a list of number of days for aging and i want to add a column that calculate the range by '0-90 days, 90-180 days, 181 - 360 days. Example, anything fall in 90 days, then it will show under the range 0 - 90 days in the range column. How can i create this column in power BI?
Solved! Go to Solution.
HI @daydream1989 ,
You can add a calculated column in PowerBI using below formula:
Resultcolumn =
SWITCH(
Table1[Open Workflow Aging],
Table1[Open Workflow Aging] >0 && Table1[Open Workflow Aging] <=90,"0-90 days",
Table1[Open Workflow Aging] >90 && Table1[Open Workflow Aging] <=180,"90-180 days",
Table1[Open Workflow Aging] >180 && Table1[Open Workflow Aging] <=360,"180-360 days"
)
I hope this will solve your problem and if you have any queries then please let me know.
And if this helps you then please give it a kudos and accept it as a solution.
Thank you.
Try this,
Resultcolumn =
SWITCH(
TRUE(),
Table1[Open Workflow Aging] >0 && Table1[Open Workflow Aging] <=90,"0-90 days",
Table1[Open Workflow Aging] >90 && Table1[Open Workflow Aging] <=180,"90-180 days",
Table1[Open Workflow Aging] >180 && Table1[Open Workflow Aging] <=360,"180-360 days"
)
I have just changed first argument to TRUE().
If this solves your problem then please give it a kudos and accept it as a solution.
Thank you.
HI @daydream1989 ,
You can add a calculated column in PowerBI using below formula:
Resultcolumn =
SWITCH(
Table1[Open Workflow Aging],
Table1[Open Workflow Aging] >0 && Table1[Open Workflow Aging] <=90,"0-90 days",
Table1[Open Workflow Aging] >90 && Table1[Open Workflow Aging] <=180,"90-180 days",
Table1[Open Workflow Aging] >180 && Table1[Open Workflow Aging] <=360,"180-360 days"
)
I hope this will solve your problem and if you have any queries then please let me know.
And if this helps you then please give it a kudos and accept it as a solution.
Thank you.
Hi, but i get the below error. How can i fix it?
Try this,
Resultcolumn =
SWITCH(
TRUE(),
Table1[Open Workflow Aging] >0 && Table1[Open Workflow Aging] <=90,"0-90 days",
Table1[Open Workflow Aging] >90 && Table1[Open Workflow Aging] <=180,"90-180 days",
Table1[Open Workflow Aging] >180 && Table1[Open Workflow Aging] <=360,"180-360 days"
)
I have just changed first argument to TRUE().
If this solves your problem then please give it a kudos and accept it as a solution.
Thank you.
Really thanks a lot!!!
Refer to this post > https://community.powerbi.com/t5/Desktop/Power-BI-DAX-Function-SWITCH-does-not-support-comparing-val...
Regards,
Ritesh
User | Count |
---|---|
123 | |
69 | |
67 | |
58 | |
52 |
User | Count |
---|---|
185 | |
92 | |
67 | |
62 | |
52 |