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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Alaeldin
New Member

Customize column based on another columns

Dears,

 

i have issue that i have a coulmn "Rent Amount" should take 4 diffrent values based on other coulmns in same view.

First the source data is sql view.

 

conditions:

1- if the coulmn "Type of Furnishing" = furnished then "Rent Amount" should get amount of furnished.

2- if the coulmn "Type of Furnishing" = unfurnished the "Rent Amount" should get amount of unfurnished.

3- if the coulmn "Type of Furnishing" = null the "Rent Amount" should get null.

4- if the coulmn "Status" = Owner Residence the "Rent Amount" should get null.

 

i hope someone can help me on that because im new in power bi.

 

Best Regards

3 REPLIES 3
MartynRamsden
Solution Sage
Solution Sage

Hi @Alaeldin 

 

I assume you're wanting to create the 'Rent Amount' column as a calculated column?

If so, try this:

 

Rent Amount =
VAR TypeOfFurnishing = SELECTEDVALUE( Table1[Type of Furnishing] )
VAR Status = SELECTEDVALUE( Table1[Status] )
VAR Result =
    SWITCH(
        TRUE(),
        Status = "Owner Residence", BLANK(),
        TypeOfFurnishing = "Furnished", Table1[Furnished],
        TypeOfFurnishing = "Unfurnished", Table1[Unfurnished],
        BLANK()
    )
RETURN
    Result

 

Best regards,
Martyn


If I answered your question, please help others by accepting it as a solution.

Hi @MartynRamsden 

 

thanks for reply and appriciate your code, but this code will be done in power bi or sql query ?

Hi @Alaeldin 

 

The DAX expression can be used to define a column within Power BI (or SSAS, if that's what you're using.)

 

Best regards,
Martyn


If I answered your question, please help others by accepting it as a solution.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.