Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to show Month Name in sorted order when connecting with SAP HANA Views in direct query mode

Hi,

 

I have a Direct query connection with SAP HANA View. The query used for creating the view sorts the complete data by Date field but i am unable to get sorted data in my desktop report.

 

 Capture.PNG

 

Since i am using a direct query mode i do not have any option to sort by column under Modeling. I have created a hierarchy as follows:

Year>month_name>week_number>date . When i drill down to month_name this is what i see.

Any suggestions on how can i sort month names.

Thanks in advance.

9 REPLIES 9

Hi,

 

I'm not sure, but i think you could put the month number into the field quick info and sort by this value.

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Raman
New Member

Try this...

Create a Date_Calendar Calculation view and choose Data Category as CUBE. When you will connect this CUBE type Cal View in Power BI Sort by Column option in the Modeling tab will be activated.

You don't need to create any measure in this just keep all the columns as Attribute in Semantics node.

Now you can use Month_Number column to sort Month_Name in this Date_Calendar Cal View.

Here the catch is to create the Date CV as CUBE and not as DIMENSION.

 

Reagrds

Raman

Hi Raman, 

your suggestion is only an option for import mode, not direct query mode, right? 

 

i'm testing here also HANA connectivity with latest versions, and see following problems:

- "Date" Datatype only works in Import noch DQ Mode... Also "Date" is set as "Semantic Type" in the HANA column

- "SortBy" equivalent of PBI is not settable in HANA. Using an "Rank" in HANA View doesn't work

- Only solution working so far in DQ for sorting month Name = Set "Label Column" = Monthname for Column with MonthNO --> User MonthNo column in PBI

 

Anonymous
Not applicable

In Hana, if you have a Month Number field use the Month Name field as the "Label Column" in your Semantic layer.  When it goes into Power BI, Power BI will show your Month Number field with Month Names instead, but will sort by Month Number.  

Power BI will also generate a hidden field, Month Number.Key that will contain the month number.

Anonymous
Not applicable

Thanks for your response. 🙂

Can you please explain this with an example or screenshots 

 

Regards

Power BI User

quentin_vigne
Solution Sage
Solution Sage

Hi @Anonymous

 

Go to the data tab, choose your table and then go to the modelisation tab and click on Sort By Column : choose you date column and it should work.

 

- Quentin

Anonymous
Not applicable

Hi Quentin,

 

Since i am using a direct query mode , sort by column option is not available.

Is there any other way to do this.

 

Thanks

 

@Anonymous

 

The only idea that I have left is to : 


Create a view of your table that you are using that will have an OrderBy ASC on Datecolumn

 

- Quentin

Anonymous
Not applicable

Hi Quentin,

 

Thanks for such a quick response 🙂

I have tried doing that as well. The HANA view i am connecting with Power BI ,its query uses order by DATE ASC.

Still does not work.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.