Urgent help - Distinct count of a column in a GroupBy table
I am creating a calculated table where the data is as below. I need to calculate the distinct count of the Order column and perform ranking over it. I have the ranking figured out, but unable to create a table with GroupBy function to calculate the distinct count of the OrderNumber. Is there an alternative approach? Any help is highly appreciated.
Order Count = GROUPBY(Datasource,Datasource[City],Datasource[YEAR],Datasource[OrderType],Datasource[Order no], "Count",Distinct(CURRENTGROUP(), Datasource[Order no])))