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
ggzmorsh
Helper II
Helper II

Comulative total of data between the selected dates in Race Bar Chart

I need help with a similar problem on the link below.

https://community.powerbi.com/t5/Desktop/Cumulative-data-to-show-in-bar-chart-race/m-p/787057#M37906...

 

The solution was indeed correct just had to change it a bit

 

Running Total =
CALCULATE (
    SUM ( 'Table1'[Count] ),
    FILTER (
        ALLSELECTED ( 'Table1' ),
        'Table1'[Date] <= MAX ( 'Table1[Date] )
            && 'Table1'[Client] = MAX ( 'Table1'[Client] )
    )
)

 

the result was correct only if the selected date slicer is between 31 days. If the filter exceeded 31 days it would add august month and september month's day.

 

CalendarCalendarResultResult

 

 

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @ggzmorsh ,

Do you mean add next/previous date period records(slicer selection date range) to current summarized data bar?

I think it is hard to achieve your requirement, you need to write measure formula with if statement to check current row contents and ignore calculation on 'uncompleted date period' and summarize them to previous data period.

Otherwise, these records will summarize based on current row contents group and filtered by current axis group.(year month)

Understanding DAX Auto-Exist

Row Context and Filter Context in DAX

Notice: if you are confused on coding formula, please share some sample data and expected result for test.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

 

 

Here is my pbix file. On the Project page contains the comulative data for the race bar chart.

If you select Aug1 to Aug31 on the date slicer it will give you the correct data. If you select Aug1 to Sep10 it will add Aug1-Aug10 and Sep1-Sep10 in the first 10 days of the bar chart.

 

https://drive.google.com/open?id=1fxtbvSZD-BzHnSjITCb3BnbGnGZ5KTmg

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.