Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
How do I get my id's to sort in order?
Hi @WILLIH ,
Try the following code to add a custom column that you can then sort the other column by this one:
Power Query
try if Value.Is (Number.From([ID]), type number) then Text.PadStart([ID], 10 , "0" ) else [ID] otherwise [ID]
Dax
Column = IF(IFERROR(VALUE('Table'[ID]);BLANK()) = BLANK();'Table'[ID];REPT("0";10 - LEN('Table'[ID])) & 'Table'[ID])
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @WILLIH ,
You need to convert the values into number, on the query editor if you click 123/ABC button you can select number on format.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi MFelix,
I did try changing the format of the data to a number but it still does not let me sort it. You can't see it from the pictures but some of the id's also have alpha in them like "D0017" or "EB255". Would that make a difference because the data is still being recognized as text?
Thanks,
WILLIH
Hi @WILLIH if you alphanumeric codes you cannot convert to number,
Believe the best option is to add a new column with some additional zeros to the left on alll the number so you can then sort the numbers.
Not on computer now but will send out the code tomorrow.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português