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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Fabi
Frequent Visitor

Cumul with filter date

Hi all !

 

I have a report like this :

Fabi_0-1668773385788.png

I would like that, when I select a year in the filter, it sums the selected year and all the previous years.

Exemple : if I select 2021 in the filter, I should therefore have A = 4, B = 11 and C = 14. If I select 2022: A = 6, B = 15, C = 20.

 

I tried with several calculations (CALCULATE, SELECTEDVALUES, ALL, etc.) but I didn't succeed, using the dates filter always breaks everything.

 

If anyone has an idea that would be great because I'm really stuck... Thank you 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

Jihwan_Kim_0-1668774843130.png

 

 

Jihwan_Kim_1-1668774959861.png

 

 

Expected measure: =
CALCULATE ( SUM ( Data[Value] ), 'Year'[Year] <= MAX ( 'Year'[Year] ) )

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
Fabi
Frequent Visitor

Thanks @FreemanZ  and @Jihwan_Kim ,

 

The solution of @Jihwan_Kim work simply.

 

In my real data, I was working with a date field and it didn't work. I had to extract in another column the year and use this one for it to work.

 

Thanks !

FreemanZ
Super User
Super User

Supposing your table named Data, try to plot the measure with the code below:
Measure := 
VAR _year =
    SELECTEDVALUE ( Data[Year])
VAR _Result =
CALCULATE (
    SUM(Data[inscriptions]),
    Data[Year]<=_year
)
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

Jihwan_Kim_0-1668774843130.png

 

 

Jihwan_Kim_1-1668774959861.png

 

 

Expected measure: =
CALCULATE ( SUM ( Data[Value] ), 'Year'[Year] <= MAX ( 'Year'[Year] ) )

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors