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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
gselvag
Helper I
Helper I

Running Total as continous line in Combo Chart

Hi folks,
I have got challenge resolve a running total as a continous line, and that cut/break after last value (date).

 

DataTable:
The datatable have different forecasts (ref ReportPeriod) that need to be evaluated as seperate measure.

 

table_pbi2.JPG

 

Measures:

Since there's multiple forecasts dataset, we made a measure to filter by MIN(DATA[ReportPeriod]). This measure works fine.

GM (BAC) --- period values: THIS IS OK!

GM (BAC) = 
VAR Report_BAC = 'Measure'[Report BAC]   //MIN(DATA[ReportPeriod])
RETURN
CALCULATE (
    SUMX(DATA; 
        DATA[Value] * [CurrFactor]);
        DATA[ReportPeriod]=Report_BAC
    )

GM (BAC) Total --- value running total: NOT WORK AS EXPECTED!

GM (BAC) Total = 
    CALCULATE(
        SUMX( DATA; [GM (BAC)]);
        FILTER( ALL('Calendar'[Date]); 'Calendar'[Date]<= MAX('Calendar'[Date]))
        )

graph_pbi2.JPG

 

The GM (BAC) Total should show a running end total of 850 000,- but include both forecasts, thus existing filter's removed. How to include filter from DATA table to show correct value (ref. RED) and blank value after 2018/Aug (ref. BLUE).

Appreciate any feedback and guidance for a correct running total measure. 

1 ACCEPTED SOLUTION

Hi @gselvag,

 

Try this formula, please. 

GM (BAC) Total =
VAR maxReportPeriod =
    CALCULATE ( MAX ( Data[ReportDate] ), ALL ( 'Calendar' ) )
RETURN
    IF (
        MIN ( 'Calendar'[Date] ) > maxReportPeriod,
        BLANK (),
        CALCULATE (
            [GM (BAC)],
            FILTER (
                ALL ( 'Calendar'[Date] ),
                'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
            )
        )
    )

Running_Total_as_continous_line_in_Combo_Chart

 

Best Regards,

Dale

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

View solution in original post

4 REPLIES 4
v-jiascu-msft
Employee
Employee

Hi @gselvag,

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

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

Hi,

This video might solve your issue https://youtu.be/YwEtrvJQVC8.

D

GM (BAC) Total.. = 
VAR FirstDateRange = [FirstDateRange]
VAR LastDateRange =  [LastDateRange]
VAR GM_Total = TOTALYTD([GM (BAC)]; 'Calendar'[Date])
RETURN
IF ( MAX('Calendar'[Date])>= FirstDateRange; 
    IF( MIN('Calendar'[Date])<= LastDateRange; GM_Total; BLANK());BLANK())

Give this result:

graph_pbi5.JPG

This doesn't resolve my issue. It return blank in 2018/Jul. Try to fix by change to:

 

GM (BAC) Total.. = 
VAR FirstDateRange = [FirstDateRange]
VAR LastDateRange =  [LastDateRange]
VAR GM_Total = TOTALYTD([GM (BAC)]; 'Calendar'[Date])
RETURN
IF ( MAX('Calendar'[Date])>= FirstDateRange; GM_Total; BLANK())

But give this result, a running total to the end of the year and not 2018/aug.

graph_pbi6.JPG

We don't understand why this occur, and can't combine two condition (Values between Min/Max data date range). Please advise, thanks for any assistance here.  

Hi @gselvag,

 

Try this formula, please. 

GM (BAC) Total =
VAR maxReportPeriod =
    CALCULATE ( MAX ( Data[ReportDate] ), ALL ( 'Calendar' ) )
RETURN
    IF (
        MIN ( 'Calendar'[Date] ) > maxReportPeriod,
        BLANK (),
        CALCULATE (
            [GM (BAC)],
            FILTER (
                ALL ( 'Calendar'[Date] ),
                'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
            )
        )
    )

Running_Total_as_continous_line_in_Combo_Chart

 

Best Regards,

Dale

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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