Reply
avatar user
Anonymous
Not applicable
Partially syndicated - Outbound

Filter a week of the year and sum the values of that week plus the values of all other weeks before.

Hello everyone,

 

I have a dashboard based on weeks of the year, and I need to count the products based on the week they are approved.

 

For example, on week 15 have 15 itens aproved, on week 16 have 3 products approved, on the week 22 I have approved other 2 itens, and so on. The column chart it's alright, it shows the information like this: week 1=0 Porducts, week 2=0 Porducts, (......), week 15=15 products, week 16=18 Products, week 17=18 Products,  week 18=18 Products,  week 19=18 Products,  week 20=20 Products.

But my KPI card it's not right, because when I select for example the week 20, it filter only the values of this week and not make the sum of all other weeks before. How can I filter on the slicer the week selected plus all the weeks before?

1 ACCEPTED SOLUTION
FrankAT
Community Champion
Community Champion

Syndicated - Outbound

Hi @Anonymous 

you can do it like this:

 

13-11-_2020_21-53-07.png

 

Sum WTD = 
CALCULATE(
    SUM('Table'[Items]),
    FILTER(
        ALL('Table'),
        'Table'[Week] <= SELECTEDVALUE('Table'[Week])
    )
)

 

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

View solution in original post

2 REPLIES 2
FrankAT
Community Champion
Community Champion

Syndicated - Outbound

Hi @Anonymous 

you can do it like this:

 

13-11-_2020_21-53-07.png

 

Sum WTD = 
CALCULATE(
    SUM('Table'[Items]),
    FILTER(
        ALL('Table'),
        'Table'[Week] <= SELECTEDVALUE('Table'[Week])
    )
)

 

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

avatar user
Anonymous
Not applicable

Syndicated - Outbound

Hi Frank!

 

Thank's a lot. It work perfectly.

avatar user

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)