Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
How can I create and add a new column in Power BI to mimick the excel formulas below?
=IF(NUMBERVALUE(C2)<=250,"0-250",IF(NUMBERVALUE(C2)<=500,"251-500",IF(NUMBERVALUE(C2)<=750,"501-750",IF(NUMBERVALUE(C2)<=1000,"751-1000",IF(NUMBERVALUE(C2)<=1250,"1001-1250",IF(C2="2000","2000",IF(C2="9000","9000",LEFT(C2,4))))))))
| Index | Phase | first four | Section |
| 1 | 0001-0000 | 0001 | 0-250 |
| 2 | 0002-0000 | 0002 | 0-250 |
| 3 | 0003-0000 | 0003 | 0-250 |
| 4 | 0004-0000 | 0004 | 0-250 |
| 5 | 0004-1000 | 0004 | 0-250 |
| 6 | 0005-0000 | 0005 | 0-250 |
| 7 | 0005-1000 | 0005 | 0-250 |
| 2246 | 9000-1520 | 9000 | 9000 |
| 2247 | 9000-1530 | 9000 | 9000 |
| 2248 | 9000-1540 | 9000 | 9000 |
| 2251 | 9999-9000 | 9999 | 9999 |
| 2252 | 9999-9960 | 9999 | 9999 |
| 2253 | 9999-9970 | 9999 | 9999 |
| 2254 | 9999-9999 | 9999 | 9999 |
Solved! Go to Solution.
For First Four, use following DAX formula and change the column to Whole Number
First Four = LEFT('Table'[Phase],4)
For Section, use following DAX formula
SWITCH(
TRUE(),
'Table'[First Four]<=250,"0-250",
'Table'[First Four]<=500,"251-500",
'Table'[First Four]<=750,"501-750",
'Table'[First Four]<=1000,"751-1000",
'Table'[First Four]<=1250,"1001-1250",
'Table'[First Four]=2000,"2000",
'Table'[First Four]=9000,"9000",
LEFT('Table'[First Four],4)
)
For First Four, use following DAX formula and change the column to Whole Number
First Four = LEFT('Table'[Phase],4)
For Section, use following DAX formula
SWITCH(
TRUE(),
'Table'[First Four]<=250,"0-250",
'Table'[First Four]<=500,"251-500",
'Table'[First Four]<=750,"501-750",
'Table'[First Four]<=1000,"751-1000",
'Table'[First Four]<=1250,"1001-1250",
'Table'[First Four]=2000,"2000",
'Table'[First Four]=9000,"9000",
LEFT('Table'[First Four],4)
)
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.