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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Mapping of two different Dates for running total calculation

Hi 

I am trying to calculate cumulative update  of target table and  plot the bar line chart using cumulative target and cumulative amount column which should get filtered by amount date.I tried creating Date table as one to filter both the table bot it did not work.

But it is just giving values for 5 months.

below are data table

Any suggestion would be appreciated.

 
 

inv.PNG

8 REPLIES 8
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Amount:

a1.png

 

Target:

a2.png

 

Calendar(a calculated table):

Calendar = CALENDARAUTO()

 

Relationship:

a3.png

 

You may create two measures as below.

Cumulative Amount = 
CALCULATE(
    SUM(Amount[Amount]),
    FILTER(
        ALL(Amount),
        [Amount Date]<=MAX('Calendar'[Date])
    )
)
Cumulative Target = 
CALCULATE(
    SUM(Target[Target]),
    FILTER(
        ALL(Target),
        [Target Date]<=MAX('Calendar'[Date])
    )
)

 

Finally you need to use 'Date' column from 'Calendar' table as x axis.

a4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @v-alq-msft :

The  given formulae  are working now for Date column and filtering properly ,but now issue is the cumulative total does not get filtered  by Category  column.

Any suggestion would be appreciated.

 

Hi, @Anonymous 

 

You may modify the relationship and formula as below.

Relationship:

a1.png

 

Formula:

 

Cumulative Amount = 
CALCULATE(
    SUM(Amount[Amount]),
    FILTER(
        ALLSELECTED(Amount),
        [Amount Date]<=MAX('Calendar'[Date])
    )
)
Cumulative Target = 
CALCULATE(
    SUM(Target[Target]),
    FILTER(
        ALLSELECTED(Target),
        [Target Date]<=MAX('Calendar'[Date])
    )
)

 

 

Result:

a2.pnga3.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Hi @v-alq-msft 

Thank you for your inputs.But it is still not working.

I am attaching the PBIX file.

https://1drv.ms/u/s!AjdwZYc0AFcWhxe_JX9O9F_rHR-h?e=GBv57x 

 

Thanks in advance

 

 

 

Hi, @Anonymous

 

It seems correctly with your formulas. Could you please show us the expected result?

d1.pngd2.png

 

Best Regards

Allan

Anonymous
Not applicable

Hi @v-alq-msft 

Cumulative Target count does not change if I use the field  "Asset" from Document table as a slicer .

case 1:Cumulative target changing when Asset field used from same table

DAX_Learner07_6-1614678958166.png

 

case 2:Using asset filed from Document table to filter cumulative target and culmulative document count.

DAX_Learner07_7-1614679017230.png

 

 

So If I use Target asset field it only filters cumulative target not cumulative document count similarly if I use Document asset field it only filters cumulative document count not cumulative target measure.

I want one common slicer which can filter both cumulative measures.

 

 

 

 

 

parry2k
Super User
Super User

@Anonymous if I understood correctly, you added a date table and created the relation from the date table with these two tables on the date, 'one to many', one on the date table side, and many on these table sides, correct? Until this part all is correct, share your cumulative total measure to look into it why it is not working.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi @parry2k ,

Yes ,that's correct ,"Date table" is connected to both the tables using one to many relationship.

Please find measure formula ,for target cumultaive

Target Count running total in Date =
CALCULATE(
SUM('Target table'[target]),
FILTER(
ALL('Date Table'[Date Column]),
'Date Table'[Date Column]<=MAX('Date Table'[Date Column])
)
)

 

 

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!

December 2024

A Year in Review - December 2024

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