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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Convert DAX calculated column formula to SQL

Hi All,

 

I have two tables:
Orders table (Contains 1 row per orders placed with customer and revenue data as whole)

Order line items table (Contains brief Order data with line items bought within the order)


I used below formula to create a new column in 'Orders' table' which is referring values from 'Order Line Items' table and assigning values in new column. Now I need to create a new column in 'Orders' table itself.

 

What is the SQL equivalent of the following DAX (Power BI) Formula:

 

 

Order Table column = 
VAR Brand = CALCULATE ( SELECTEDVALUE ( 'Order Line Items'[Brand] ) )
RETURN
    IF ( 
        ISBLANK ( Brand ),
        "Mixed Order",
        Brand
    )

 

 

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

Maybe you can try the following syntax to update the data in Column 'Brand‘.

Update TableName set xxxx where xxxx

 

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.