Forum Discussion
harshaltannu
8 years agoRegular Visitor
DAX flag for Last Completed Week (filter)
Hello DAX gurus I'm trying to create a filter in the DimDate table (my data table), which would put the flag as 1 when the data is in last completed week. This table sits on a SQL server, which I...
- 8 years ago
Hi Harshal.
There are some limitations of applying DAX functions in the DirectQuery mode. Try out the following formula as a calculated column please.
BTW, the dates in your sample aren't continuous. I would suggest you use a complete date table instead.
LastWholeWeek = VAR currentWeek = WEEKNUM ( TODAY (), 1 ) VAR weekNum = IF ( [Weekday] IN { 5, 6, 7 }, WEEKNUM ( [Date], 1 ) + 1, WEEKNUM ( [Date] ) ) RETURN IF ( weekNum = currentWeek - 1, 1, BLANK () )Best Regards,
Dale
ChandeepChhabra
8 years agoImpactful Individual
harshaltannu
8 years agoRegular Visitor
ChandeepChhabra: how can I send you the sample data file?
- ChandeepChhabra8 years agoImpactful Individual
harshaltannu Upload it on dropbox / google / onedrive and share the link
- harshaltannu8 years agoRegular Visitor
ChandeepChhabra: thanks, here is the link: https://www.dropbox.com/s/69nnw4rkk6x1s6o/DimDate.xlsx?dl=0
- ChandeepChhabra8 years agoImpactful Individual
harshaltannu : Can you also share a sample of the calculated column (output) you are expecting ?