Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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
https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
User | Count |
---|---|
77 | |
77 | |
68 | |
67 | |
49 |
User | Count |
---|---|
108 | |
105 | |
93 | |
83 | |
64 |