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
Anonymous
Not applicable

Combine Conditional columns

Hi, 

I have created two conditional columns using dax, now i want to Combine these columns into a single column. 

I tried to use pivot/Unpivot option in the transform data section, but in the transform data section these newly created conditional column will not appear .

Please help me on this. how can i Combine these columns. 

11500af7-ff55-4522-94db-3d76b80f96c5.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1648516701200.png

Power query will only display your source data, the columns you create with dax will not be displayed in Power query.

Here are the steps you can follow:

1. Create calculated table.

Table 2 =
var _1=
{
    "Qtr",
    "YTD"
}
var _2=VALUES('Table'[Index])
return
CROSSJOIN(_1,_2)

2. Create calculated column

Combine =
var _1=
CALCULATE(MAX('Table'[Qtr Status]),FILTER(ALL('Table'),'Table'[Index]=EARLIER('Table 2'[Index])))
var _2=
CALCULATE(MAX('Table'[YTD]),FILTER(ALL('Table'),'Table'[Index]=EARLIER('Table 2'[Index])))
return
IF(
    [Value]="YTD",_2,_1)

3. Result:

vyangliumsft_1-1648516701201.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1648516701200.png

Power query will only display your source data, the columns you create with dax will not be displayed in Power query.

Here are the steps you can follow:

1. Create calculated table.

Table 2 =
var _1=
{
    "Qtr",
    "YTD"
}
var _2=VALUES('Table'[Index])
return
CROSSJOIN(_1,_2)

2. Create calculated column

Combine =
var _1=
CALCULATE(MAX('Table'[Qtr Status]),FILTER(ALL('Table'),'Table'[Index]=EARLIER('Table 2'[Index])))
var _2=
CALCULATE(MAX('Table'[YTD]),FILTER(ALL('Table'),'Table'[Index]=EARLIER('Table 2'[Index])))
return
IF(
    [Value]="YTD",_2,_1)

3. Result:

vyangliumsft_1-1648516701201.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

mh2587
Super User
Super User

Can you provide the screenshot what would be your expected output


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Anonymous
Not applicable

I want a single column for Qtr Status and  YTD  values, instead of having different column.

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.

Top Solution Authors