Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

totalytd incorrect

Solved: Combining data - Microsoft Power BI Community

 

Hi all, 

 

I had earlier an issue with combining data which was solved by speedramps in the above topic and for which you find the details below.

 

To combine my data, the following measure was created :

 

Your answer = 

IF(ISEMPTY[YTD]),
SUM(LE[actual]),
SUM(ACTUALS[actual])
)

 

Now I would like to create a YTD measure. I have created the following measure, but it only shows YTD values until April. From May onwards, it shows the actuals per month. 

 

YTD = totalytd([your answer], 'Calendar'[Date])

 

Any idea what I do wrong?

 

 

Spoiler

 

I have the following 2 tables :

 

ACTUALS 
periodactuals
01.01.202210
01.02.20225
01.03.20226
01.04.20227
01.05.20228
01.06.20229
01.07.202213

 

LE 
periodactuals
01.01.20227
01.02.20226
01.03.20223
01.04.20224
01.05.202215
01.06.202213
01.07.202212

 

I would like to create a measure or calculated column where I combine data based on period data from another table with the conditition that IF the Actuals[period] occurs in the below table (ytd period), it should take the actuals of ACTUALS. If the period doesn't appear in ytd period, it should take the period and actuals of LE.

 

ytd period
01.01.2022
01.02.2022
01.03.2022
01.04.2022

 

End result :

 

End result 
  
01.01.202210
01.02.20225
01.03.20226
01.04.20227
01.05.202215
01.06.202213
01.07.202212

 

 

I had earlier an issue with combining data which was solved in the above topic. Now from there I would like to create a YTD table.

 

Hi all,

 

I have the following 2 tables :

 

ACTUALS 
periodactuals
01.01.202210
01.02.20225
01.03.20226
01.04.20227
01.05.20228
01.06.20229
01.07.202213

 

LE 
periodactuals
01.01.20227
01.02.20226
01.03.20223
01.04.20224
01.05.202215
01.06.202213
01.07.202212

 

I would like to create a measure or calculated column where I combine data based on period data from another table with the conditition that IF the Actuals[period] occurs in the below table (ytd period), it should take the actuals of ACTUALS. If the period doesn't appear in ytd period, it should take the period and actuals of LE.

 

ytd period
01.01.2022
01.02.2022
01.03.2022
01.04.2022

 

End result :

 

End result 
  
01.01.202210
01.02.20225
01.03.20226
01.04.20227
01.05.202215
01.06.202213
01.07.202212

 

Now I would like to create a YTD of the measure 

 

Your answer = 

IF(ISEMPTY[YTD]),
SUM(LE[actual]),
SUM(ACTUALS[actual])
)

 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    thanks so much! 

    I appreciate your advice to start with the calendar video. I have started but this this is a long process 🙂 

     

    In the meantime I will prepare my model to share it on Onedrive.

7 Replies