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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Multiple columns with multiple conditions

i have the following table with column names stage, lead date, salesqualify date, oppurtunity date, customer date, subscribe date only

 

how to get output column?

 

want output column using dax or power query.

 

.

 

 

stagelead datesalesqualify dateoppurtunity datecustomer datesubcribe dateoutput
       
       
lead12-01-201812-06-2018null  12-01-2018
salesQualifynull12-01-2018nullnullnull12-01-2018
oppurtunitynullnull12-01-2018nullnull12-01-2018
customernull12-05-2018null12-06-2018null12-06-2018
subscribernullnullnullnull12-08-201812-08-2018

 

if the stage column have lead, return lead date as a output column

if the stage column have salesqualifty, return salesqualify date as a output column

if the stage column have oppurtunity, return oppurtunity date as a output column,etc

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

Create a calcuated column with DAX 

Column =
SWITCH (
    [stage],
    "lead", [lead date],
    "salesQualify", [salesqualify date],
    "oppurtunity", [oppurtunity date],
    "customer", [customer date],
    "subscriber", [subcribe date]
)

2.png

 

Best Regards

Maggie

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

Create a calcuated column with DAX 

Column =
SWITCH (
    [stage],
    "lead", [lead date],
    "salesQualify", [salesqualify date],
    "oppurtunity", [oppurtunity date],
    "customer", [customer date],
    "subscriber", [subcribe date]
)

2.png

 

Best Regards

Maggie

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.