Forum Discussion
DAX Command to merge multiple Columns into One column
If you want to do it easily, do it in Power Query.
Add a conditional column
- Anonymous7 years agoNot applicable
Thanks for the response but the solution I'm after is more like a row based condition where, imagine today as the split in time between past and future. For the sake of example lets say, past is Q1, Q2 and future is Q3 and Q4. Data is tabular and each Qtr has it's own column. So there are 4 columns for Q1,Q2,Q3,Q4.
At this point in Time (Past=Q1, Q2, Future=Q3,Q4) We need to get the numbers partly from Q1 And Q2 for the past dates and partly from Q3 and Q4 for future periods. This means either a new measure or new column where all 4 qtr's are consolidated via a rule. With what you proposed is either or or each column. What I need is a combination of coulmns.
I did a bit of try and error and couldn't find the solution to be handled via measures. easiest seems to be a new column with a formula to determine the rule is applied at a granular level on each row. It effects the performance though.
Column formule is something like
"Current Budget = SWITCH(True(),
AND(Month<SYSDATE(),Month in Q1), Q1_Budget,
AND(Month<SYSDATE(),Month in Q2), Q2_Budget,
AND(Month<SYSDATE(),Month in Q3), Q3_Budget,
AND(Month<SYSDATE(),Month in Q4), Q4_Budget,
Month>SYSDATE(), Budget of CURRENT_MONTH_QUARTER
)
Does that make more sense?
Thanks,