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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.