Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi!
There is a measure that compares year to year amounts.
Zmiana % R/R =
IF(
ISFILTERED('BudgetPlans'[EffectiveDate]),
ERROR("Szybkie miary analizy czasowej mogą być grupowane i filtrowane tylko w hierarchii dat dostarczonej przez usługę Power BI lub podstawowej kolumnie dat."),
VAR __PREV_YEAR =
CALCULATE(
SUM('BudgetPlans'[TransactionCurrencyAmount]),
DATEADD('BudgetPlans'[EffectiveDate].[Date], -1, YEAR)
)
RETURN
DIVIDE(
SUM('BudgetPlans'[TransactionCurrencyAmount]) - __PREV_YEAR,
__PREV_YEAR
)
)
Although it is a standard measure of power bi - in the table it is attached to each result (regardless of whether it is day / month / year). I would like to see it only for year, but i don't see a way to hide it. (hiding colums hides date instead of this) I can truncate those columns width to 0, but this wraps the lines so report is unclear.
@jeyjey344 , Not very clear. For Year on Year comparison always use date table
example
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
//Only year vs Year, not a level below
This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
Appreciate your Kudos.