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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
ma_azj24
Frequent Visitor

DirectQuery Transpose Column Data to Multiple Rows via SQL

Hi, I'm working with a dataset from SAP HANA and am storing the database via DirectQuery. I have been transforming the table output via SQL but need help with returning values from the "Scheduled" column based on the "Category" as new columns.

 

From

DateVehicle CodeFrom LocTo LocCategoryScheduled
21/05/2024Q123SYDBNEDepart21/05/2024 10:00
21/05/2024Q123SYDBNEArrive21/05/2024 11:00
21/05/2024Q123OOLBNEDepart21/05/2024 09:00
21/05/2024Q123OOLBNEArrive21/05/2024 10:00

 

To

DateVehicle CodeFrom LocTo LocDepartArrive
21/05/2024Q123SYDBNE21/05/2024 10:0021/05/2024 11:00
21/05/2024Q123OOLBNE21/05/2024 09:0021/05/2024 10:00
2 REPLIES 2
amitchandak
Super User
Super User

@ma_azj24 , If you want to do that in Power Query (Unpivot column) and this table will become import mode table

 

of you can create you use measures

calculate(  Min(Table[Scheduled]), filter(Table, Table[Category] = "Depart" ) )

 

calculate(  Min(Table[Scheduled]), filter(Table, Table[Category] = "Arrive" ) )

Thank you for suggesting a solution. Unfortunately, I am required to use DirectQuery so using Power Query to transform the data is not an option for me. I will keep this in mind for my import mode datasets! 🙂

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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