Forum Discussion
Showing only Last Week progress
- 4 years ago
Thanks v-chenwuz-msft .
The relationship between my tables is like you are suggesting.
I've solved the issue by doing this:
%Actual_Last_Week =VAR var_MAX_Date = calculate(MAX('NLU Distribution - ACTUAL'[Week_Rank]),ALL())RETURNCALCULATE(PROJECT[%Actual_by_Category],'Project Calendar'[Week_Rank]=var_MAX_Date,all('Project Calendar'[Week_Rank]))Basically...declaring a VAR to define the MAX Date...removing ALL the filters to ensure MaxWeek it's the same for every category.Many thanks for your support,
Following amitchandak advice...I've updated:
- Transactional table: I've added a column Week_Rank = RELATED('Project Calendar'[Week_Rank]), to "link" the transaction dates with the week number.
- Project Calendar: I've added a column Week_Rank = RANKX(ALL('Project Calendar'),'Project Calendar'[Week_Start_Day],,ASC,Dense), to add the chronological week number to my calendar
And I've done some additional measures trying to show only the %Actual of last calendar week, instead of the %Actual of last week with data.
1) %Actual_Last_Week = CALCULATE(
- v-chenwuz-msft4 years agoCommunity Support
Hi jcarlos ,
1 Set relationship cross filter direction is from 'Project Calendar' table to 'NLU Distribution - ACTUAL' table single and one to many.
2 try code like following :
%Actual_Last_Week = CALCULATE( DIVIDE( [ACTUAL_SUM_NLU], [SUM_Weightage_By_Date] ), WEEKNUM( 'Project Calendar'[date] ) = WEEKNUM( MAX( 'NLU Distribution - ACTUAL'[date] ) ) - 1 )if does not work fine, please share pbix file without sensitive data.
Best RegardsCommunity Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- jcarlos4 years agoHelper I
Thanks v-chenwuz-msft .
The relationship between my tables is like you are suggesting.
I've solved the issue by doing this:
%Actual_Last_Week =VAR var_MAX_Date = calculate(MAX('NLU Distribution - ACTUAL'[Week_Rank]),ALL())RETURNCALCULATE(PROJECT[%Actual_by_Category],'Project Calendar'[Week_Rank]=var_MAX_Date,all('Project Calendar'[Week_Rank]))Basically...declaring a VAR to define the MAX Date...removing ALL the filters to ensure MaxWeek it's the same for every category.Many thanks for your support,