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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Robbief
Helper II
Helper II

Running Totals on Selected Dates

Hi 

I've looked, but can't seem to find a solution, and keep running down rabbit holes, so am reaching out for some help / direction on how to tackle this.

 

I have a Transaction Table, with Sales with Dates and Time.  I've got two additional supporting tables for Date and Time respectively.  I've created a measure for Running Total of Transactions throughout the day, and would like to compare any two days of my choosing.

 

My initial idea is to create another Date table, and create two seperate measures, one for Date 1, and the other for Date 2, and have both measures appear on the same graph....  But I appear to be coming unstuck...   

 

This is the measure I am using (Non Date Filtered):

Cumulative Sales (Calendar 1) = IF (
    COUNTROWS ( 'Transaction Line' ) > 0,
    CALCULATE (
        [Sum Transactions],
        FILTER (
            ALLSELECTED ( 'Time Table'[Time] ),
            'Time Table'[Time] <= MAX ( ( 'Time Table'[Time]) )
        )
    ),
    BLANK ()
)
 
IS my approach right?  If not, what approach would you consider?

 

1 ACCEPTED SOLUTION
Robbief
Helper II
Helper II

Thanks for the pointer.  In the end I used USERELATIONSHIP to achieve exactly what I wanted:   

**Except for Dynamically naming the series based on the slicer date selection............  😞  

 

Robbief_0-1664990310286.png

 

View solution in original post

3 REPLIES 3
Robbief
Helper II
Helper II

Thanks for the pointer.  In the end I used USERELATIONSHIP to achieve exactly what I wanted:   

**Except for Dynamically naming the series based on the slicer date selection............  😞  

 

Robbief_0-1664990310286.png

 

Robbief
Helper II
Helper II

I could see that...  But am not sure on how to create a measure on a table that isn't connected in the Schema - Do I create a "virtual join" in the code (Using something like Lookupvalue) ?

Greg_Deckler
Super User
Super User

@Robbief If you are choosing 2 dates that are both connected to the same fact table via something like slicers, then this will cause problems. You would need those tables to be disconnected tables (no relationship) for that to work.

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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