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
eryka_90
Helper I
Helper I

Total Cumulative - Date Hierarchy

Hi,

 

I'm having an issue when to visualize Total cumulative in Metrix table or chart. The total cumulative showing right value when I'm not using date hierarchy (Document Date) but when it's change to date hierarchy, the value showing incorrect. 

# Total Cumulative $ =
CALCULATE(
    [#Total Amount],
    FILTER(
        ALL('Vendor Open Item'[Document Date]),
        'Vendor Open Item'[Document Date] <= MAX('Vendor Open Item'[Document Date])
    )
)
Document Date#Total Amount USD# Total Cumulative $# Open Doc Count# Total Cumulative
10/24/2017 -650-65011
3/8/2018 -670.74-1320.7412
11/30/2018 -1038-2358.7413
12/13/2018 -11394.19-13752.9314
2/15/2019 -1998-15750.9315
5/13/2019 -9828-25578.9316
2/7/2020 325.12-25253.8117
4/3/2020 -564.41-25818.2218
4/15/2020 -1359.67-27177.8919

 

Expected result to visualize as below:

eryka_90_1-1726062231596.png

 

Any help/suggestion would be appreciated.

 

TQVM

 

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Try this approach

  1. Create a Calendar Table with calculated column formulas for Year, Month name and Month number.  Sort the Month name column by the Month number
  2. Create a relationship (Many to One and Single) from the Date column of the Fact Table to the Date column of the calendar Table
  3. To your visual, drag Date from the Calendar Table
  4. Write this measure

Measure = calculate([#total amount],datesbetween(calendar[date],minx(all(calendar),calendar[date]),max(calendar[date])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Try this approach

  1. Create a Calendar Table with calculated column formulas for Year, Month name and Month number.  Sort the Month name column by the Month number
  2. Create a relationship (Many to One and Single) from the Date column of the Fact Table to the Date column of the calendar Table
  3. To your visual, drag Date from the Calendar Table
  4. Write this measure

Measure = calculate([#total amount],datesbetween(calendar[date],minx(all(calendar),calendar[date]),max(calendar[date])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur ,

 

Thank you for your suggestion.

The issue has been resolved.

 

Regards,

Eryka

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-jialongy-msft
Community Support
Community Support

Hi @eryka_90 

Please try the following Measure:

# Total Cumulativeeeeee = 

VAR _select_date = SELECTEDVALUE('Vendor Open Item'[Document Date])
RETURN
CALCULATE(
    SUM('Vendor Open Item'[#Total Amount USD]),
    FILTER(
        ALL('Vendor Open Item'),
        'Vendor Open Item'[Document Date] <= _select_date)
    )

 

 

 

Result:

vjialongymsft_0-1726106020093.png

 

 

 

 

 

 

 

Best Regards,

Jayleny

 

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

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.