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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors