Forum Discussion
max date table value
- Anonymous2 years ago
I managed to find the answer here: DAX Tables – Calendar and Time – Ville Gullstrands blogg (villezekeviking.com)
Using the following measures for last week, the week before & previous 8 weeks:
Sessions_2W = CALCULATE(SUM([Sessions]), dim_date[week_offset]=-2)Sessions_LW = CALCULATE(SUM([Sessions]), dim_date[week_offset]=-1)Sessions_8W =var _wk1 = CALCULATE(SUM([Sessions]), dim_date[week_offset]=-9)var _wk2 = CALCULATE(SUM([Sessions]), dim_date[week_offset]=-2)var _wk3 = CALCULATE(SUM([Sessions]), dim_date[week_offset]=-3)var _wk4 = CALCULATE(SUM([Sessions]), dim_date[week_offset]=-4)var _wk5 = CALCULATE(SUM([Sessions]), dim_date[week_offset]=-5)var _wk6 = CALCULATE(SUM([Sessions]), dim_date[week_offset]=-6)var _wk7 = CALCULATE(SUM([Sessions]), dim_date[week_offset]=-7)var _wk8 = CALCULATE(SUM([Sessions]), dim_date[week_offset]=-8)return (_wk1 + _wk2 + _wk3 +_wk4 +_wk5 + _wk6 + _wk7 + _wk8)
Hi Anonymous it could be that you did not create Calendar / Date table in Power BI as feature?
If yes, please check link how to create it with week number. After that make connection Calendar / Date table with your fact table.
Use COUNTROWS to count transaction and filter / slicer to see it by week.
- Anonymous2 years agoNot applicable
Hi some_bih
Ah yes, I the dates table is marked as such and there is a many to one relationship between the 'dim_date[Date] & 'landingpagemarketing[Date] which is the start of any given week.
- some_bih2 years agoCommunity Champion
Hi Anonymous if max date is needed then simple MAX( yourtable_date_column) is possible option