Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have the below table where the percentages (4%, 5%, 10%, 15%, etc) were created by a switch statement. I then grouped those percentages into ranges as shown below. To get the ranges in the correct order I tried another switch statement and another grouping, but both produced an error. How do I go about putting these ranges in the correct order? Thanks.
Solved! Go to Solution.
Hi @cheid_4838
Or you can have seperate table with idle subgrouping and sorting order.
create relationship between your idle sub grouping an dyou table sub grouping.
use idle subgrouping from newly created seperate table. make sure you apply sort by order step on idle sub groping (new table).
use only idle sub grouping from new table rest column from your old table.
I hope this might help you!
Hi @cheid_4838
You Idle Grouping is sorting in correct order > like if you see every open catgeory hav proper sorting in Asc order.
So i Think you dont need to fix your idle grouping because your Main hierarchy is not sorted order.
You have to fix you Idle Subgrouping which is Text column.
In text column it will sort Aplabetically.. so you 10-20% will come first because of 1 2 3 4 5 number sequence .
So sort order is 10,4,40
I hope I answered your question!
Hi @cheid_4838
try this calculated column
Order=
SWITCH(
TRUE(),
'Idle subgrouping' = 4% - 5% ,1,
'Idle subgrouping' = 10% - 20%, 2,
'Idle subgrouping' = 40% - 50%, 3,
4) ------- for other
I hope this might help you sort the order.
select your idle subgrouping
go to Column Tools tab then click sort by column
select your sort order column
I hope I answered your question!
I used this logic to create the subgroup, but get the below error message when I sort by the order logic.
Hi @cheid_4838
For your understanding you Idle sub grouping is sorting based on text column not Numeric so sorting order is 1,4,4 this is what it is following because of alphanumeric sorting .
Taking 1 element of every word then sort.
I hope this might give you clearity.
That is what I am having issues with. I need these ranges put in the correct order, but nothing is working. I have tried everything from using switch to create the order to grouping. Each time I get a circular dependency error message to not being able to compare text to numbers. Not sure what else my options are.
hi @cheid_4838
can you change your numeric text
I was thinking that, but trying to avoid putting a leading number to drive the sort. Thanks for your help.
Hi @cheid_4838
Or you can have seperate table with idle subgrouping and sorting order.
create relationship between your idle sub grouping an dyou table sub grouping.
use idle subgrouping from newly created seperate table. make sure you apply sort by order step on idle sub groping (new table).
use only idle sub grouping from new table rest column from your old table.
I hope this might help you!
Thanks for that suggestion. I was thinking that, but wanted to exhaust my efforts trying to find logic that would work. Thanks for your help.
Try this:
SortOrder =
SWITCH(
TRUE(),
'Long Idle'[Long Idle %] < .05, 1,
'Long Idle'[Long Idle %] >= .05 && 'Long Idle'[Long Idle %] < .10, 2,
'Long Idle'[Long Idle %] >= .10 && 'Long Idle'[Long Idle %] < .15, 3,
'Long Idle'[Long Idle %] >= .15 && 'Long Idle'[Long Idle %] < .20, 4,
'Long Idle'[Long Idle %] >= .20 && 'Long Idle'[Long Idle %] < .40, 5,
'Long Idle'[Long Idle %] >= .40 && 'Long Idle'[Long Idle %] < .60, 6,
'Long Idle'[Long Idle %] >= .60 && 'Long Idle'[Long Idle %] < .80, 7,
'Long Idle'[Long Idle %] > .80, 8,
9 -- "OTHER"
)
After creating the SortOrder
column:
Idle Grouping
column.SortOrder
column.This ensures the ranges in Idle Grouping
are displayed in the correct order in visuals.
I created this logic to create the subgroup and then the second logic to create the order. When I do this I get This error message.
create a column through power query(transform data) to avoid circular dependancy error.
User | Count |
---|---|
84 | |
78 | |
70 | |
47 | |
41 |
User | Count |
---|---|
108 | |
53 | |
50 | |
40 | |
40 |