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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
SachinC
Helper V
Helper V

rolling up data based on date to get a cumulative viewpoint

Hi,

i want to create a dashboard to report on elements from multiple tabs in an excel workbook.

one of the tabs has date , week number, month number and year. this will be used for my slicers.

other tabs have random dates for certain events, i.e. sales, developent etc... with retrospective values ie amount, dev days etc...

by selecting a filter, eg week 4, month 3, year 2017, i want a rollup graph of all activity to that date, i.e. all sales to the date filter selected, all dev days to date filter selected etc... how do i get this done in powerbi pls? thank you. 

2 REPLIES 2
v-sihou-msft
Microsoft Employee
Microsoft Employee

@SachinC

 

According to your description, you want to calculate the cumulative total sales and total dev days on day level. Right?

 

You just need to apply the date filter up to current row in your calculate() function. If you have one table for each event type, you can create measures like below:

 

Cumulative Sales :=
CALCULATE (
    SUM ( Sales[Sales Amount] ),
    FILTER (
        ALL ( 'Calendar'[Date] ),
        'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
    )
)
Total Dev Days :=
CALCULATE (
    COUNTROWS ( 'Dev' ),
    FILTER (
        ALL ( 'Calendar'[Date] ),
        'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
    )
)

 

If you only have one event table with a column tagging different event type, you measures can be like below:

 

Cumulative Sales :=
CALCULATE (
    COUNTROWS ( 'Event' ),
    FILTER ( ALL ( 'Event'[Type] ), 'Event'[Type] = "Sales" ),
    FILTER (
        ALL ( 'Calendar'[Date] ),
        'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
    )
)

 

Total Dev Days :=
CALCULATE (
    COUNTROWS ( 'Event' ),
    FILTER ( ALL ( 'Event'[Type] ), 'Event'[Type] = "Developer" ),
    FILTER (
        ALL ( 'Calendar'[Date] ),
        'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
    )
)

 

Regards,

Phil_Seamark
Microsoft Employee
Microsoft Employee

Is this what you are after?

 

http://www.daxpatterns.com/cumulative-total/


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.