Forum Discussion
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?
I have the following 2 tables :
| ACTUALS | |
| period | actuals |
| 01.01.2022 | 10 |
| 01.02.2022 | 5 |
| 01.03.2022 | 6 |
| 01.04.2022 | 7 |
| 01.05.2022 | 8 |
| 01.06.2022 | 9 |
| 01.07.2022 | 13 |
| LE | |
| period | actuals |
| 01.01.2022 | 7 |
| 01.02.2022 | 6 |
| 01.03.2022 | 3 |
| 01.04.2022 | 4 |
| 01.05.2022 | 15 |
| 01.06.2022 | 13 |
| 01.07.2022 | 12 |
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.2022 | 10 |
| 01.02.2022 | 5 |
| 01.03.2022 | 6 |
| 01.04.2022 | 7 |
| 01.05.2022 | 15 |
| 01.06.2022 | 13 |
| 01.07.2022 | 12 |
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 | |
| period | actuals |
| 01.01.2022 | 10 |
| 01.02.2022 | 5 |
| 01.03.2022 | 6 |
| 01.04.2022 | 7 |
| 01.05.2022 | 8 |
| 01.06.2022 | 9 |
| 01.07.2022 | 13 |
| LE | |
| period | actuals |
| 01.01.2022 | 7 |
| 01.02.2022 | 6 |
| 01.03.2022 | 3 |
| 01.04.2022 | 4 |
| 01.05.2022 | 15 |
| 01.06.2022 | 13 |
| 01.07.2022 | 12 |
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.2022 | 10 |
| 01.02.2022 | 5 |
| 01.03.2022 | 6 |
| 01.04.2022 | 7 |
| 01.05.2022 | 15 |
| 01.06.2022 | 13 |
| 01.07.2022 | 12 |
Now I would like to create a YTD of the measure
Your answer =
IF(ISEMPTY[YTD]),
SUM(LE[actual]),
SUM(ACTUALS[actual])
)
- Anonymous4 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
- AnonymousNot applicable
thanks speedramps
I understand the measure that you provided earlier :
IF(ISEMPTY[YTD]),
SUM(LE[actual]),
SUM(ACTUALS[actual])But what I would like to do is to create a YTD as below. I did not fully finish the videos around calendar training, but note that I already have a calendar table in my model.
End result 01.01.2022 10 10 01.02.2022 5 15 01.03.2022 6 21 01.04.2022 7 28 01.05.2022 15 43 01.06.2022 13 56 01.07.2022 12 68
- speedramps
Super User
Use a Calender with YearOffet and DayOffset
YTD value =
CALCUATE( [yourmeasure], calendar[YearOffet] = 0, calendar[YearOffset]DayOffset <= 0)See the videos for more info
- AnonymousNot applicable
Thanks, I think I still need some training/time to fully understand this concept 🙂
Would there be another way to come to the desired result? Currently it looks like below, but this is not correct as you can see.
The forecast shows correct values per month (incorrect total).
The forecast ytd shows correct data until april. From may it takes the total forecast.
- AnonymousNot applicable
hi speedramps,
any idea? otherwise I will perhaps create a new topic with my full model and to better explain what my desired result would be 🙂