Forum Discussion
Year over year without blank
Hi,
I am trying to calculate a simple Year over Year, but when i am using the Prior Year amount, it show me in the table all the month of the year blank.
The probleme is its take in account all the previous period amount instead of taking the selected period which is until july 2024
| Year | Cal Month Name | BI Partner | Current period | Previous period | Collection Mom amount | Collection Amount YoY% |
| 2023 | July | X | 1436764 | 1148214 | 25% | 25.13% |
| 2023 | August | X | 965800 | 1163823 | -17% | -17.01% |
| 2023 | September | X | 2141258 | 564432 | 279% | 279.37% |
| 2023 | October | X | 1050222 | 787280 | 33% | 33.40% |
| 2023 | November | X | 915906 | 1314162 | -30% | -30.30% |
| 2023 | December | X | 2276381 | 1914868 | 19% | 18.88% |
| 2023 | January | X | 2526859 | 1784051 | 42% | 41.64% |
| 2023 | February | X | 1902772 | 1116479 | 70% | 70.43% |
| 2023 | March | X | 930311 | 832858 | 12% | 11.70% |
| 2023 | April | X | 1765239 | 774473 | 128% | 127.93% |
| 2023 | May | X | 1979149 | 553429 | 258% | 257.62% |
| 2023 | June | X | 2711691 | 2563789 | 6% | 5.77% |
| 2024 | July | X | 1734835 | 1436764 | 21% | 20.75% |
| 2024 | August | X | 965800 | -100% | ||
| 2024 | September | X | 2141258 | -100% | ||
| 2024 | October | X | 1050222 | -100% | ||
| 2024 | November | X | 915906 | -100% | ||
| 2024 | December | X | 2276381 | -100% | ||
| 2024 | January | X | 2526859 | -100% | ||
| 2024 | February | X | 1902772 | -100% | ||
| 2024 | March | X | 930311 | -100% | ||
| 2024 | April | X | 1765239 | -100% | ||
| 2024 | May | X | 1979149 | -100% | ||
| 2024 | June | X | 2711691 | -100% |
I tried something like that but the total is still not correct :
1 Reply
- rajendraongole1
Super User
Hi menphis21 - create a measure to calculate the collection amount using sameperiodlastyear function
Previous Year Amount =
CALCULATE(
[Collection Amount],
SAMEPERIODLASTYEAR(Collection[Fiscal date].[Date])
)create another measure YOY
YoY Percentage =
VAR CurrentYearAmount = [Collection Amount]
VAR PreviousYearAmount = [Previous Year Amount]
RETURN
IF(
NOT ISBLANK(CurrentYearAmount) && NOT ISBLANK(PreviousYearAmount),
DIVIDE(CurrentYearAmount - PreviousYearAmount, PreviousYearAmount, 0),
BLANK()
)Hope your visual filters out blank values appropriately. This step depends on how you set up your visual and filters in Power BI.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!