The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
The following code only brings back the ELSE parameter 9, I can't work out why?
RANK2 Sort = SWITCH(
TRUE(),
'Cases'[Age Profile2] = "0-3 Mths",1,
'Cases'[Age Profile2] = "3-6 Mths",2,
'Cases'[Age Profile2] = "6-9 Mths",3,
'Cases'[Age Profile2] = "9-12 Mths",4,
'Cases'[Age Profile2] = "12-15 Mths",5,
'Cases'[Age Profile2] = "15-18 Mths",6,
'Cases'[Age Profile2] = "18-21 Mths",7,
'Cases'[Age Profile2] = "21-24 Mths",8,
9)
The Age Profile Column my Sort Column is referencing is here:
Age Profile2 =
if( 'Cases'[Case Length (Validation Date)] < 90.25 , " 0-3 Mths",
if('Cases'[Case Length (Validation Date)] < 182.5, " 3-6 Mths",
if('Cases'[Case Length (Validation Date)] < 273.75, " 6-9 Mths",
if('Cases'[Case Length (Validation Date)] < 365.25, " 9-12 Mths",
if('Cases'[Case Length (Validation Date)] < 456.25, " 12-15 Mths",
if('Cases'[Case Length (Validation Date)] < 547.5, " 15-18 Mths",
if('Cases'[Case Length (Validation Date)] < 638.75, " 18-21 Mths",
if('Cases'[Case Length (Validation Date)] < 730, " 21-24 Mths",
"24+ Mths"))))))))
Any ideas why this is going wrong?
Thanks
Solved! Go to Solution.
Hello,
Try to copy paste the same value exactly as SWITCH Is case sensitive, I see some spaces in your values
example :
" 0-3 Mths"
While in your switch function:
"0-3 Mths"
So I dont think its considering them the same values.
Please accept this as a solution if it helped you 🙂
Hello,
Try to copy paste the same value exactly as SWITCH Is case sensitive, I see some spaces in your values
example :
" 0-3 Mths"
While in your switch function:
"0-3 Mths"
So I dont think its considering them the same values.
Please accept this as a solution if it helped you 🙂
Yes, thanks, the answer was starring me in the face!
Much appreciated!!
User | Count |
---|---|
83 | |
82 | |
34 | |
33 | |
32 |
User | Count |
---|---|
93 | |
79 | |
62 | |
54 | |
51 |