Forum Discussion
Append 2 calculated columns using DAX
Hi Community,
- Sample data: Table 1 which I am currently using contains values per Month/Year for each IND L2, as you can see the first 3 columns are might be used a hierarchy.
- Target (Table2):
- Represents the SUM of the previous year (I will add Previous month later) according to a selected Month&Year
- in this case the both columns IND L1 and IND L2 must be appended in one column
IND | Values
IND_1 | value
IND_2 | sum(IND_3 & IND_4)
IND_3 | value
IND_4 | value
Calculating the Previous Year values and Previous Month values for each IND L2 was perfectly done, and using a matrix visual combined with a hierarchy I was able also to show the same thing either for IND L1 or IND L2.
=> Currently I am stuck in finding a way to append the both columns in one and maintaining the same calculations, I'd appreciate any suggestions you may have to move from Table1 to Table 2.
Thank you in advance Community.
Hi v-xicai
Thank you for your replay.
The first solution I thought about was using a matrix by it didn't answer my need which was appending those 2 columns in one new column.After hours I acheived the result I was looking for by using the function UNION
Thank you community.
8 Replies
- lbendlinSuper User
please provide the sample data in usable format, not as a screenshot.
- DataVitalizerSuper User
Hi @lbendlin
Here is a sample:Rubric,IND L1,IND L2,Date,Value
R1,IND_1,IND_1,1/1/2017,100
R1,IND_1,IND_1,1/1/2018,150
R1,IND_1,IND_1,1/1/2019,200
R1,IND_2,IND_3,1/1/2017,250
R1,IND_2,IND_3,1/1/2018,300
R1,IND_2,IND_3,1/1/2019,350
R1,IND_2,IND_4,1/1/2017,400
R1,IND_2,IND_4,1/1/2018,450
R1,IND_2,IND_4,1/1/2019,500
R2,IND_5,IND_6,1/1/2018,550
R2,IND_5,IND_6,1/1/2019,600
R2,IND_5,IND_7,1/1/2018,650
R2,IND_5,IND_7,1/1/2019,700
R2,IND_8,IND_8,1/1/2017,750
R2,IND_8,IND_8,1/1/2018,800Thank you in advance
@Greg_Deckler @amitchandak- lbendlinSuper User
Unless I am missing some subtlety here your hierarchy doesn't really matter. Any aggregations you do in your visual will produce the desired results.