Forum Discussion
how to: Direct Query hierarchical (two level) sql query into Power BI
this is what I mean. How do I import the query to PBI?
as you can see from the picture I posted above, there are two levels of data. Level one (makred as 1 in red) and level two (marked as 2 in red). When I import the query like how I normally do by going into 'Get data' and selecting 'SQL Server' and following the procedure, I only get data for the top row (marked in red). I want to know, how can I get import the query from SQL to Power BI so that I can see all the data
- v-juanli-msft6 years agoCommunity Support
Hi OPS-MLTSD
I can't find any official documents discussing about it.
Based on my knowledge, Power BI doesn't support "hierarchial data" to generate dynamically when data source is with direct query.
Could you try to paste the "hierarchical sql query" in the "SQL statement" under the "Advanced options"?
Or create calcualted columns in Power BI to create hierarchical columns?
Video:
How to create hierarchial with power bi
Best Regards
Maggie
- OPS-MLTSD6 years agoPost Patron
because of privacy reasons I can't paste the query. Is there any other way?