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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
IrisW
Regular Visitor

Difficult sum

In my report, I have a date filter. With this I select one date, for example Dec. 31, 2023.

 

My source data is structured as follows:

 

IDStartdateUntildateValue
1Nov. 1, 2023Nov. 2, 202340
1Nov. 2, 2023Nov. 3, 202350
1Nov. 3, 2023Nov. 4, 202360
1Feb. 1, 2024Feb. 2, 202480
2Nov. 2, 2023Nov. 3, 202350
2Nov. 3, 2023Nov. 4, 202340
3Nov. 13, 2023Nov. 14, 202350
3Nov. 14, 2023Nov. 15, 202360

 

Power BI should give me the sum of all the Values where the date in the Untildate column is largest (per ID) under the selected date. So in this example, 60+40+60 = 160.

 

IDStartdateUntildateValue
1Nov. 1, 2023Nov. 2, 202340
1Nov. 2, 2023Nov. 3, 202350
1Nov. 3, 2023Nov. 4, 202360
1Feb. 1, 2024Feb. 2, 202480
2Nov. 2, 2023Nov. 3, 202350
2Nov. 3, 2023Nov. 4, 202340
3Nov. 13, 2023Nov. 14, 202350
3Nov. 14, 2023Nov. 15, 202360

 

Is this possible?

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

ThxAlot_1-1736946284252.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



View solution in original post

2 REPLIES 2
ThxAlot
Super User
Super User

ThxAlot_1-1736946284252.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



bhanu_gautam
Super User
Super User

@IrisW ,  Create a measure to find the largest Untildate per ID that is under the selected date.
Create another measure to sum the values corresponding to these largest Untildate values.

 

DAX
Max_Untildate_Under_Selected =
CALCULATE(
MAX('Table'[Untildate]),
FILTER(
'Table',
'Table'[Untildate] <= SELECTEDVALUE('Date'[Date])
)
)

Sum_Values_Largest_Untildate =
SUMX(
SUMMARIZE(
'Table',
'Table'[ID],
"Max_Untildate", [Max_Untildate_Under_Selected]
),
CALCULATE(
SUM('Table'[Value]),
'Table'[Untildate] = [Max_Untildate]
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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