Forum Discussion
Nethunt
8 years agoFrequent Visitor
Report data from same week previous year
Appended dataqueries from several companies to a new query in Power BI. Every company query has almost the same columns (YearWeek, SalesTotal, SalesA, SalesB, SalesC, ........). Before appending i ...
Anonymous
8 years agoNot applicable
Hi Nethunt,
I think you can add '-1' to filter on pervious year.
LAST YEAR sales total =
VAR current_company =
LASTNONBLANK ( 'GROUP'[Company], [Company] )
RETURN
CALCULATE (
SUM ( 'GROUP'[salestotal] ),
FILTER (
ALL( 'GROUP' ),
'GROUP'[Year]
= SELECTEDVALUE('Table'[Year])-1
&&'GROUP'[Week]= MAX('GROUP'[Week])
&& 'GROUP'[Company] = current_company
)
)
Regards,
Xiaoxin Sheng
Nethunt
8 years agoFrequent Visitor
Hello Anonymous,
Thanks for your reaction.
I tried that already. After that the line disappears.
So probably something with text / value indentification ?
In both tables 'GROUP' and 'YEAR', the datatype for [YEAR] is set on whole number.
I even tried to add a column [YEAR-1] in the 'YEAR' table and picked thisone as a selectedvalue; in that case the line isn't also visable.
- Anonymous8 years agoNot applicable