Forum Discussion
Anonymous
7 years agoNot applicable
Formatting Year and Calendar Week
Hello, I have a data set, which includes a column for year (2018 and 2019) and a column for calendar week (1,2,3...) Is it possible to format the columns so that they are recognized as year ...
- Anonymous7 years ago
Hi,
have you a Year dimension table? Or have you just one large table?
If you have a table Calendar with the list of Year, you can create these measures:
TotalValue = SUM(Value)
TotalValue PY = CALCULATE([TotalValue], FILTER( ALL(Calendar), Calendar[Year] = MAX(Calendar[Year])-1))
Total Value YoY = TotalValue - TotalValue PY
% vs TotalVaue PY = DIVIDE(Total Value YoY, TotalValue PY)
Anonymous
7 years agoNot applicable
Yes, but my column "year" is not recognized in the selection field as a valid option.
Anonymous
7 years agoNot applicable
Even though I tricked and entered fake dates I recieved the following error message (sorry for german)
Netto Umsatz YoY% 2 =
IF(
ISFILTERED('powerbi'[Datum]);
ERROR("Quickmeasures mit Zeitintelligenz können nur über die von Power BI bereitgestellte Datumshierarchie oder die primäre Datumsspalte gruppiert oder gefiltert werden.");
VAR __PREV_YEAR =
CALCULATE(
SUM('powerbi'[Netto Umsatz]);
DATEADD('powerbi'[Datum].[Date]; -1; YEAR)
)
RETURN
DIVIDE(SUM('powerbi'[Netto Umsatz]) - __PREV_YEAR; __PREV_YEAR)
)