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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
CEllis
Resolver I
Resolver I

Bring forward weekly measure where their is no data.

 

I am trying to achive a weekly continuation where there is no data.

 

Data Set 1 stops on the 24th May and doesnt continue because there is no more data entered.

Data Set 2 continues to have data entered.

Cummulative is Data Set 1 and Data Set 2 cummulative figure to date

 

Can Data Set 1 appear in the Cummulative figure after the 24th May ?

 

Sample Chart

CEllis_1-1718023388360.png

 

 

Data Set 1 and Data Set 2 = 

Var _Today = TODAY()
//-7 is to get the previouse full week.
Var DateBetween = DATESBETWEEN('Attendance (Table)'[Mark date],MIN('Academic Year (Table)'[Dates]),MAX('Today (Table)'[End of week])-7)

Var Present         =  CALCULATE(SUM('Attendance (Table)'[Present]),DateBetween)
Var Authorised      =  CALCULATE(Sum('Attendance (Table)'[Authorised Absence]),DateBetween)
Var UnAuthorised    =  CALCULATE(Sum('Attendance (Table)'[UnAuthorised]),DateBetween)
Var AEA             =  CALCULATE(Sum('Attendance (Table)'[AEA]),DateBetween)

Var TotalPresent    = (Present+AEA)
Var Absent          = (Authorised+UnAuthorised)
Var TotalMarks      = TotalPresent+Absent

Return

        IFERROR((TotalPresent/TotalMarks),0))

 

Cummulative = 

Var Present = 
	CALCULATE (SUM ('Attendance (Table)'[Present]),FILTER (ALL ( 'Academic Year (Table)'[Week Ending] ),'Academic Year (Table)'[Week Ending]  <= MAX ( 'Academic Year (Table)'[Week Ending])))
	+
	CALCULATE (SUM ('Attendance (Table)'[AEA]),FILTER (ALL ( 'Academic Year (Table)'[Week Ending] ),'Academic Year (Table)'[Week Ending]  <= MAX ( 'Academic Year (Table)'[Week Ending])))

Var absent =
	CALCULATE (SUM ('Attendance (Table)'[Authorised Absence]),FILTER (ALL ( 'Academic Year (Table)'[Week Ending] ),'Academic Year (Table)'[Week Ending]  <= MAX ( 'Academic Year (Table)'[Week Ending])))
	+
	CALCULATE (SUM ('Attendance (Table)'[UnAuthorised]),FILTER (ALL ( 'Academic Year (Table)'[Week Ending] ),'Academic Year (Table)'[Week Ending]  <= MAX ( 'Academic Year (Table)'[Week Ending])))

Var Overall = Present+absent

Return

IFERROR(Present/Overall,0)

 

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @CEllis ,

 

Thanks @amitchandak  for the quick reply, allow me to provide another insight:

You can create a measure.

MEASURE =
CALCULATE (
    SUM ( 'Attendance (Table)'[AEA] ),
    FILTER (
        ALL ( 'Attendance (Table)' ),
        [Date] <= MAX ( 'Academic Year (Table)'[Week Ending] )
    )
)


Then the result is as follows.

vtangjiemsft_1-1718160524838.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

2 REPLIES 2
v-tangjie-msft
Community Support
Community Support

Hi @CEllis ,

 

Thanks @amitchandak  for the quick reply, allow me to provide another insight:

You can create a measure.

MEASURE =
CALCULATE (
    SUM ( 'Attendance (Table)'[AEA] ),
    FILTER (
        ALL ( 'Attendance (Table)' ),
        [Date] <= MAX ( 'Academic Year (Table)'[Week Ending] )
    )
)


Then the result is as follows.

vtangjiemsft_1-1718160524838.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

amitchandak
Super User
Super User

@CEllis , is dataset 2 means 'Academic Year (Table)'[Week Ending] 

This table should have all the dates of week ending to work

 

measure like below should work

CALCULATE (SUM ('Attendance (Table)'[AEA]),FILTER (ALL ( 'Academic Year (Table)'[),'Academic Year (Table)'[Week Ending] <= MAX ( 'Academic Year (Table)'[Week Ending])))

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors