Forum Discussion
Limit week to current week
Hello All,
Hope you are fine.
I am trying to limit my table to the current week but unfortunately, it is not working:
My sales figures are being retrieved from the server on a daily basis, however, my budget column is from an excel file which I loaded.
I tried the below but it does not seem to work:
OR
Hi Anonymous
You may try this measure for the budget of the current week:
Current_wk_budget = VAR _CurrentDate = TODAY () VAR _CurrentWeekYear = CALCULATE ( MAX ( 'Calendar'[YYYY-WK] ), 'Calendar'[Date] = _CurrentDate ) RETURN CALCULATE ( SUM ( BUDGET[Budget_1] ), 'Calendar'[YYYY-WK] = _CurrentWeekYear, 'Calendar'[Date] <= _CurrentDate )For weekly sales, your measure is also calculating sum from BUDGET table instead of any Sales table. Is the daily sales data in the same BUDGET table?
If this doesn't help, can you please share some sample data as well as expected result in table format? Does your "current week" need to be compared with today's date? For example, as the current week is 202304, do you want to show only this week's data in the table or do you want to show data of all weeks before or on this week? Sample data is important to help us understand what you have and try to provide a possible solution quickly.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
1 Reply
- v-jingzhangCommunity Support
Hi Anonymous
You may try this measure for the budget of the current week:
Current_wk_budget = VAR _CurrentDate = TODAY () VAR _CurrentWeekYear = CALCULATE ( MAX ( 'Calendar'[YYYY-WK] ), 'Calendar'[Date] = _CurrentDate ) RETURN CALCULATE ( SUM ( BUDGET[Budget_1] ), 'Calendar'[YYYY-WK] = _CurrentWeekYear, 'Calendar'[Date] <= _CurrentDate )For weekly sales, your measure is also calculating sum from BUDGET table instead of any Sales table. Is the daily sales data in the same BUDGET table?
If this doesn't help, can you please share some sample data as well as expected result in table format? Does your "current week" need to be compared with today's date? For example, as the current week is 202304, do you want to show only this week's data in the table or do you want to show data of all weeks before or on this week? Sample data is important to help us understand what you have and try to provide a possible solution quickly.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.