Forum Discussion
Categorising a column
Hi All,
I have a Score column(whole number) and based on the scores I need to create a new column and categorise them as Very Low, Low, Medium, High, Very High. Can someone help me with the logic to achieve this in DAX.
Note: The score value changes periodically.
11 Replies
- JorgePinhoSolution Sage
Hello DianaChris !
You can create a DAX Column and use something like this:
Column =
SWITCH(TRUE(),
Score> *Value1*, "Label1",Score > *Value2*, "Label2",
"")- DianaChrisFrequent Visitor
Hello JorgePinho,
Thanks for your solution. But, the score column will be changing periodically. So, I can't mention a static value in the code. The code should dynamically handle the changing score values. Is there a way?
- JorgePinhoSolution Sage
Hello, DianaChris. The score is dynamic in my solution since it references the column values. If the column values change the new column will be calculated again.
The only thing that is static in my solution is the tresholds (Value1 and Value2) to define the category. You want to turn those dynamic as well?
- AbbasGMemorable Member
DianaChris This can be done by adding a conditional column.
Here is the sample pbix file for your reference. https://1drv.ms/u/s!ArEx6MabNbWof3sI_4c0J7pkz98?e=hQzJ4YHope it helps.
- DianaChrisFrequent Visitor
Hi AbbasG
Thanks for your solution. But, as mentioned, the score column will be changing periodically. So the range of score varies every period.
- AbbasGMemorable Member
DianaChris if you can share sample data or pbix file with more information, may be I can help better.