Forum Discussion
electrobrit
Post Patron
7 years agoweek over week but same day comparison
I have 2 tables: Date and Cases which is daily detail of the cases coming in daily. I would like a simple line chart to show weekly comparison with the past 7 days and a line comparing the previous ...
PattemManohar
Community Champion
7 years agoelectrobrit Please try this as a "New Column"
CaseClosurePrevWeek = LOOKUPVALUE(Test79PrevDay[CaseClosureThisWeek],Test79PrevDay[Date],DATEADD(Test79PrevDay[Date],-7,DAY))
- electrobrit7 years ago
Post Patron
Thank you PattemManohar. One issue, I don't know how to solve. My case closure time is in the cases table 'duration_days'
Using your calc column-i used this below
CaseClosurePrevWeek = LOOKUPVALUE(VW_Cases[Duration_Days], 'Date'[Date],DATEADD('Date'[Date],-7,DAY))
I am getting this message
A table of multiple values was supplied where a single value was expected.What am I doing wrong?
Thanks again!
- PattemManohar7 years ago
Community Champion
electrobrit I believe the "Date" field and "Duration_Days" in the sample data are in the same table. Is that not the case ? Please confirm.
I can see that you are using two different tables in the DAX expression. The DAX that I've provided is based on the assumption that both fields are in the same table.- electrobrit7 years ago
Post Patron
PattemManohar I like what you did though. My original data table I was showing what I wanted to be able to get to in the solution. Sorry about that.
They are 2 different tables. I have a date table and the case table and have related them.