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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
nicoenz
Helper III
Helper III

Running total values and value for future periods

Hi everyone,

i have a table that contains Volume data for December and January. As of January 7, there's no more data

 

The running total measure that i use:

Running total =   var Turro = CALCULATE(SUM('Table'[Volume]),
                            filter(ALL('Table'),'Table'[Fiscal year/period] = MAX('Table'[Fiscal year/period])),
                            filter(ALL('Table'),'Table'[WorkDayPeriod] <= MAX('Table'[WorkDayPeriod])))
                           
                            return
                            If(Turro <>0,
                                Turro,
                                Turro+ CALCULATE(SUM('Table'[Volume]),REMOVEFILTERS('Table'[WorkDayPeriod]))
                                )

gives the following table:
nicoenz_0-1704897767941.png

 

Since there are no future data after January 7 there's no value at all but I would like to have a flat line from day 7 till 22 with the last value.
 
nicoenz_0-1704895134426.png

 

 

How can I make it?

 

Regards and happy 2024!

1 ACCEPTED SOLUTION

I couldn't make it work because future dates were not included so the measures didn't know what to do. I solved it by adding a manual table with future dates, appending this new table with my FactTable, adjusting the measures and voila!!!

i guess it's not the best and tidiest way of doing it but it works so far

View solution in original post

9 REPLIES 9
nicoenz
Helper III
Helper III

Hi @v-yiruan-msft and @Ashish_Mathur Ashish

here's the link to the file: https://drive.google.com/file/d/1ynTnYK1FaCR-vPr5h8z6zEBfo_4lyddo/view?usp=drive_link 

Thanks for your help!!!!!!!

Access Denied message.


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

didnt give access to all with the link. sorry

please try again: https://drive.google.com/file/d/1ynTnYK1FaCR-vPr5h8z6zEBfo_4lyddo/view?usp=sharing 

Hi,

  1. Create a relationship (Many to One and Single) from the Posting Date column of Table to the Date column of the DateTable.
  2. Create the WorkDayPeriod column in the DateTable
  3. In the Table visual, drag the WordDayPeriod and Date columns from the DatTable

Make these changes and share the link of the revised PBI file.


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

Hi @Ashish_Mathur ,

done!! it kind of works but the flat segment on the last days is that the initial value level instead of the last value level. See pbix file

https://drive.google.com/file/d/1bKbBZQ3k1Ql1jgDYztiXmRtxOzROD1F_/view?usp=sharing 

thanks again!!!!!

I couldn't make it work because future dates were not included so the measures didn't know what to do. I solved it by adding a manual table with future dates, appending this new table with my FactTable, adjusting the measures and voila!!!

i guess it's not the best and tidiest way of doing it but it works so far

Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


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

Hi @nicoenz ,

Thanks for reaching out to us with your problem. Base on your description, it seems that you want to get the running total for the future dates. You can follow the steps to get it:

1. Create a separated date dimension table(DO NOT create any relationship with your fact table)

2. Apply the date field of date dimension table on X-axis of your line chart

3. Update the formula of measure [Running total] as below

Running total =
VAR Turro =
    CALCULATE (
        SUM ( 'Table'[Volume] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Fiscal year/period] = SELECTEDVALUE ( 'Date'[Date] )
        ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[WorkDayPeriod] <= SELECTEDVALUE ( 'Date'[Date] )
        )
    )
RETURN
    IF (
        Turro <> 0,
        Turro,
        Turro
            + CALCULATE ( SUM ( 'Table'[Volume] ), REMOVEFILTERS ( 'Table'[WorkDayPeriod] ) )
    )

If the above one can't help you get the expected result, please provide some raw data in your table (exclude sensitive data) with Text format, your line chart Fields settings and your expected result with special examples and screenshots. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

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

Hi Rena, i tried and couldn't make it work. tried tweaking it a bit to no avail. 

I will upload the file with some more explanations

thanks!!!!

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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