Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
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.
Solved! Go to Solution.
Hi @Anonymous ,
I created some data:
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:
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
Hi @Anonymous ,
I created some data:
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:
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
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!
I want a single column for Qtr Status and YTD values, instead of having different column.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 33 | |
| 32 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 66 | |
| 65 | |
| 44 | |
| 30 | |
| 29 |