Forum Discussion
Sort column Values in Power BI
- 7 years ago
Hi Anonymous,
Could you have tried add the index column in query editor?
Reference:https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
Regards,
Daniel He
Hi Anonymous,
Could you have tried add the index column in query editor?
Reference:https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
Regards,
Daniel He
Hi v-danhe-msft,
Thanks for the reply. But I want to sort this column like below:
1st all RST related and Quarterly sorted values and then sorted by Period,
then ACT (Actuals) related values,
then Plan related. Something like below :
RST Q2'17
RST Q3'17
RST FY'17
ACT + LE P02 Q2'18
ACT + LE P02 Q3'18
ACT + LE P02 Q4'18
Plan Q2'18
Plan Q3'18
Plan FY'19
I could find any pattern to sort this values. So I tried writting 'Switch' statement. Added above formula.
But the 'Quarter Year' has 'Single quate' (') in it. I am not able to compare the value.
example,
qtr_yr_id =
SWITCH (
TRUE (),
'Qtr_Yr_Sort'[Quarter Year] = "RST Q2'17", "1", 'Qtr_Yr_Sort'[Quarter Year] = "RST Q3'17", "2", "3")
I am getting "3" value in the "qtr_yr_id " column. What should i write to compare the valaue when it has Single quote (') in it.
Thanks!
Regards,
Poonam