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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
ViktoriaRv
Regular Visitor

How to copy weekends to correctly calculate the average balance

Hi,
I have a balance of accounts for every working day. But there's no balance for the weekend, holliday
08.09.22   200 000
09.09.22    205 000
10.09.22     day off
11.09.22    day off
12.09.22      203 200

This balance for each account


How to copy weekends to correctly calculate the average balance.  I have an array of 1 million entries

Thss is  code does not work if the balance = 0 for the working day, it is duplicated further, but I don’t need this

Balance all date =
VAR currentDate =  MAX ('Date'[Date])
VAR LNBDate = CALCULATE ( LASTNONBLANK ( 'Date'[Date]; CALCULATE ( COUNTROWS ( 'Файлы' ) ) );
FILTER ( ALL ( 'Date'[Date]); 'Date'[Date]<= currentDate )
)
RETURN
CALCULATE ( (DIVIDE( Sumx('Файлы';'Файлы'[Balance]*RELATED(MAP_Lite[Знак (т070, т071)]));100000));
FILTER ( ALL ('Date');  'Date'[Date]= LNBDate )
)

 

There may be such a situation
08.09.22   200 000
09.09.22    205 000
10.09.22     day off
11.09.22    day off
12.09.22      0.00

13.09.22      203 000

 

should be

08.09.22   200 000
09.09.22    205 000
10.09.22     day off  205 000
11.09.22    day off  205 000
12.09.22      0.00

13.09.22      203 000

 

 

3 REPLIES 3
ViktoriaRv
Regular Visitor

It's not just the weekend.
sometimes weekends are working days.

amitchandak
Super User
Super User

@ViktoriaRv , check if this code can help little bit -https://amitchandak.medium.com/power-bi-show-weekend-data-on-monday-or-friday-dab5ee201f0e

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

It's not just the weekend.
sometimes weekends are working days.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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