Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi all,
I would like to create a new column based on the margin value where some categories need to be created so:
Between 0 - 10000 , 10000 - 20000, 20000-30000, >30000
How would you to write the right measure ?
Solved! Go to Solution.
Hi @rsanyoto ,
Incase you want to create a new Column,
New COLUMN =
SWITCH (
TRUE (),
'Table'[Margin] > 30000, ">30000",
'Table'[Margin] <= 30000
&& 'Table'[Margin] > 20000, " 20000-30000",
'Table'[Margin] <= 20000
&& 'Table'[Margin] > 10000, " 10000-20000",
"Between 0-10000"
)
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!!
Hi @rsanyoto ,
Incase you want to create a new Column,
New COLUMN =
SWITCH (
TRUE (),
'Table'[Margin] > 30000, ">30000",
'Table'[Margin] <= 30000
&& 'Table'[Margin] > 20000, " 20000-30000",
'Table'[Margin] <= 20000
&& 'Table'[Margin] > 10000, " 10000-20000",
"Between 0-10000"
)
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!!
Hello,
This is an example of the pattern called Parameter Table https://www.daxpatterns.com/parameter-table/
The basic approach is to create a table that holds your categories.
I made a small sample table
and some sample data
and then I wrote my measures, following the Pattern
one to get the value to be categorized
Help when you know. Ask when you don't!
Great YouTube video with simply explanation!
@rsanyoto , Refer if this can help