Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Running totals with value only suit the criteria

Hi , I try to calculate 8 weeks of running total thats only suits the criteria.

Like only have the running totals that have whole 8 weeks. see picture below:

WeeknrCountRolling 8 weeks countweek 
202302100 
202303200 
202304300 
202305500 
202306300 
202307200 
202308400 
20230965265202302-202309
20231035290202303-202310
2023115275202304-202311
20231215260202305-202312
20231310220202306-202313
    

Thanks for help.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please try to create a measure with below dax formula:

Rolling 8 weeks count =
VAR cur_wk =
    SELECTEDVALUE ( 'Table'[Weeknr] )
VAR min_wk =
    MINX ( ALL ( 'Table' ), [Weeknr] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), [Weeknr] <= cur_wk && [Weeknr] >= cur_wk - 7 )
RETURN
    IF ( cur_wk - min_wk >= 7, SUMX ( tmp, [Count] ), BLANK () )

vbinbinyumsft_0-1681867996883.png

Please refer the attaced .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

Please try to create a measure with below dax formula:

Rolling 8 weeks count =
VAR cur_wk =
    SELECTEDVALUE ( 'Table'[Weeknr] )
VAR min_wk =
    MINX ( ALL ( 'Table' ), [Weeknr] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), [Weeknr] <= cur_wk && [Weeknr] >= cur_wk - 7 )
RETURN
    IF ( cur_wk - min_wk >= 7, SUMX ( tmp, [Count] ), BLANK () )

vbinbinyumsft_0-1681867996883.png

Please refer the attaced .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.