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
Syndicate_Admin
Administrator
Administrator

cumulative totals from previous days and monthly

Good, my first post and I hope you can help me get out of this dilemma, I need to pass the following image to a dynamic table in powerbi of a bdd, what is complicated for me is to work the accumulated dates I have the gross sale data and goal from the current day to last year, the first row is accumulated from the current month, the last days respectively, but I can not do it, any help would be useful to me, and I attach as is my calendar table.MicrosoftTeams-image.pngCaptura.PNG

1 ACCEPTED SOLUTION

Hi, @Syndicate_Admin 

You need to create dynamic columns "Start Date","End Date" first.
Table:

64.png

So that you can use measure as below to calulate the cumulative totals:

cumulative totals_vta_bruto =
CALCULATE (
    SUM ( 'Fact table'[Vta_Bruto] ),
    FILTER (
        'Fact table',
        'Fact table'[Fecha] >= SELECTEDVALUE ( 'Table'[Start Date] )
            && 'Fact table'[Fecha] <= SELECTEDVALUE ( 'Table'[End Date] )
    )
)
cumulative totals_Meta =
CALCULATE (
    SUM ( 'Fact table'[Meta] ),
    FILTER (
        'Fact table',
        'Fact table'[Fecha] >= SELECTEDVALUE ( 'Table'[Start Date] )
            && 'Fact table'[Fecha] <= SELECTEDVALUE ( 'Table'[End Date] )
    )
)

Best Regards,
Community Support Team _ Eason

View solution in original post

3 REPLIES 3
VijayP
Super User
Super User

@Syndicate_Admin 

if you can add some sample data it will helpful to derive solution




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


This is my Main base where I have gross vta and goal that are the ones that I have to accumulate in the ranges of days that I show above, the main problem for example is the sum of gross vta according to the days.

Captura1.PNG

Hi, @Syndicate_Admin 

You need to create dynamic columns "Start Date","End Date" first.
Table:

64.png

So that you can use measure as below to calulate the cumulative totals:

cumulative totals_vta_bruto =
CALCULATE (
    SUM ( 'Fact table'[Vta_Bruto] ),
    FILTER (
        'Fact table',
        'Fact table'[Fecha] >= SELECTEDVALUE ( 'Table'[Start Date] )
            && 'Fact table'[Fecha] <= SELECTEDVALUE ( 'Table'[End Date] )
    )
)
cumulative totals_Meta =
CALCULATE (
    SUM ( 'Fact table'[Meta] ),
    FILTER (
        'Fact table',
        'Fact table'[Fecha] >= SELECTEDVALUE ( 'Table'[Start Date] )
            && 'Fact table'[Fecha] <= SELECTEDVALUE ( 'Table'[End Date] )
    )
)

Best Regards,
Community Support Team _ Eason

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.