visual studio
2 TopicsOrder By in VS to represent in Power BI
I am using a SQL Server connection in VS and importing tables. In my table, I have a Date column and then another column that is extracting the Month_Name of the Date column. Example Date Month_Name 01/05/2021 January 03/07/2021 March 08/21/2021 August I used the following script in Advanced Editor in VS to do this: #"Extracted Month Name" = Table.TransformColumns(#"Filtered Rows", {{"Month_Name", each Date.MonthName(_), type text}}) Then when I go to by Power BI dashboard and display the Month_Name in a table, it is not ordering by date, it's ordering alphabetically. (August, January, March) How do I get this column to order by date? (Can't edit the column in PBI since I'm using a VS connector)380Views0likes1CommentHow to delete everything after a dash and put the remaining text on 4 characters in DAX?
I have in Visual Studio a table `Y2_Sales` which contains a column "`color`" with values like this : 85-GREY MARLE 90-BLACK 90-BLACK 1000-WHITE 49-NAVY 90-BLACK 3021-BONE I would like to make a calculated column in my template and delete everything after the dash and put the remaining numbers on 4 characters, which would give : 0085 0090 0090 1000 0049 0090 3021 I tried this formula but it returns me for example `90-` how to remove this last dash? =LEFT([color], IF (SEARCH("-",[color],1,0) > 0, SEARCH("-",[color],1,0), LEN([color]) ) ) Could someone help me?1.3KViews0likes2Comments