Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi, in my real-life example, I don't have the individual columns per category, but I need them.
In the example below, how can I add the Bike, Scooter, and Skate columns based on the first 3 columns with the amounts in each row, please?
Date | Category | Amount | Bike | Scooter | Skate |
01/04/2025 | Bike | 475 | 475 | ||
01/04/2025 | Bike | 600 | 600 | ||
01/04/2025 | Bike | 350 | 350 | ||
02/05/2025 | Scooter | 200 | 200 | ||
02/05/2025 | Bike | 750 | 750 | ||
02/05/2025 | Skates | 150 | 150 | ||
02/05/2025 | Scooter | 80 | 80 | ||
03/06/2025 | Skates | 200 | 200 | ||
03/06/2025 | Skates | 225 | 225 | ||
03/06/2025 | Skates | 300 | 300 |
Thanks
Solved! Go to Solution.
@RichOB In Power Query, it would be something like:
Bike = if [Category] = "Bike" then [Amount] else null
Scooter = if [Category] = "Scooter" then [Amount] else null
Skates = if [Category] = "Skates" then [Amount] else null
In DAX it would be:
Bike = IF( [Category] = "Bike", [Amount], BLANK() )
Scooter = IF( [Category] = "Scooter", [Amount], BLANK() )
Skates = IF( [Category] = "Skates", [Amount], BLANK() )
Hi @RichOB ,
We haven’t received an update from you in some time. Could you please let us know if the issue has been resolved?
If you still require support, please let us know, we are happy to assist you.
Thank you.
Hi @RichOB ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
Thank you.
Hi @RichOB ,
I wanted to follow up on our previous suggestions. We would like to hear back from you to ensure we can assist you further.
Thank you.
Hi @RichOB ,
Thank you for reaching out to the Microsoft fabric community forum.
As rightly explained by @Greg_Deckler , you can achieve this either in Power Query using conditional column logic or in DAX using calculated columns. Both methods will create the expected output where each category has its own column, and the corresponding amount appears only when applicable.
Please feel free to choose the method that best fits your transformation stage (Power Query vs. data model). Also Please reach out for further assistance.
Thank you.
@RichOB In Power Query, it would be something like:
Bike = if [Category] = "Bike" then [Amount] else null
Scooter = if [Category] = "Scooter" then [Amount] else null
Skates = if [Category] = "Skates" then [Amount] else null
In DAX it would be:
Bike = IF( [Category] = "Bike", [Amount], BLANK() )
Scooter = IF( [Category] = "Scooter", [Amount], BLANK() )
Skates = IF( [Category] = "Skates", [Amount], BLANK() )