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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Calculate week on week variance

I need to calculate week on week variance for data starting from 2018 till date. Date column includes a day of the week when the data is shared (say, 3/1/2023). Month column is calculated to indicated month of the year (January 2023). Week Rank is assigned to all weeks. The DAX is shared here for your reference and I would need to know how I can make this work.

CALCULATE(
SUM('fred_h8_banking'[Amt in Bn_CF]),
FILTER(
ALL('fred_h8_banking'[Week Rank_CF], 'fred_h8_banking'[series_title], 'fred_h8_banking'[Month], 'fred_h8_banking'[A/L], 'fred_h8_banking'[banks]),
'fred_h8_banking'[Week Rank_CF] = MAX('fred_h8_banking'[Week Rank_CF])
&& 'fred_h8_banking'[series_title] = MAX('fred_h8_banking'[series_title])
&& 'fred_h8_banking'[Month] = MAX('fred_h8_banking'[Month])
&& 'fred_h8_banking'[A/L] = MAX('fred_h8_banking'[A/L])
&& 'fred_h8_banking'[banks] = MAX('fred_h8_banking'[banks])
)
)
VAR SalesLastWeek_CF =
CALCULATE(
SUM('fred_h8_banking'[Amt in Bn_CF]),
FILTER(
ALL('fred_h8_banking'[Week Rank_CF], 'fred_h8_banking'[series_title], 'fred_h8_banking'[Month], 'fred_h8_banking'[A/L], 'fred_h8_banking'[banks]),
'fred_h8_banking'[Week Rank_CF] = MAX('fred_h8_banking'[Week Rank_CF]) - 1
&& 'fred_h8_banking'[series_title] = MAX('fred_h8_banking'[series_title])
&& 'fred_h8_banking'[Month] = MAX('fred_h8_banking'[Month])
&& 'fred_h8_banking'[A/L] = MAX('fred_h8_banking'[A/L])
&& 'fred_h8_banking'[banks] = MAX('fred_h8_banking'[banks])
)
)
RETURN DIVIDE(SalesCurrentWeek_CF, SalesLastWeek_CF, 0)

0 REPLIES 0

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.