Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jeyjey344
Helper I
Helper I

Measure y2y also appears to months/days and I am unable to hide it

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.


Please help 🙂 Screen below - you can drill down in this table from year to day. Right now it is on Q1 -Q4 range of 2020 -  none of those is necessary
 
columns.JPG

 

1 REPLY 1
amitchandak
Super User
Super User

@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.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.