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
Anonymous
Not applicable

Cumulative data to show in bar chart race

Hello,

 

I want to build a bar chart race and I want to show cumulative data according to the date, filtering by the person's name, like this:

 

Created atNameCountCumulative
01/05/2019A11
02/05/2019A12
03/05/2019A13
04/05/2019B11
02/05/2019B12
03/05/2019B13
03/05/2019B14

 

As I add more data to the chart, I want this new data to be counted as well. 

 

I created a new column named "Cumulative" and I used this DAX formula:

 

CALCULATE (
SUM ('Base consolidada'[Count]),
FILTER (ALL ('Base consolidada'[Created at] ),'Base consolidada'[Created at] <= MAX ( 'Base consolidada'[Created at]))
)

 

However, this formula didn't work, and I am looking for a formula that works.

 

Thank you!

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

For your requirement, I'm afraid that you'd better create the measure with the formula below.

Measure =
CALCULATE (
    SUM ( 'Base consolidada'[Count] ),
    FILTER (
        ALL ( 'Base consolidada' ),
        'Base consolidada'[Created at] <= MAX ( 'Base consolidada'[Created at] )
            && 'Base consolidada'[Name] = MAX ( 'Base consolidada'[Name] )
    )
)

Here is the output.

Capture.PNG

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
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

3 REPLIES 3
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

Have you solved your problem?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, pleaes feel free to ask.

Best  Regards,

Cherry

 

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

The formula worked perfectly but i had to use ALLSELECTED instead of ALL so it would only give me the dates i selected from a slicer.
The only thing not workling properly is that the bar chart only counts a maximum of 31 days if you selected 2 months worth of data it adds all the days on each month.

 

How do you,

1. Increase the period from 31 days to whatever you filtered on the date slicer.

2. Not total both the day 1 up to day 31 of each month you have selected.

v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

For your requirement, I'm afraid that you'd better create the measure with the formula below.

Measure =
CALCULATE (
    SUM ( 'Base consolidada'[Count] ),
    FILTER (
        ALL ( 'Base consolidada' ),
        'Base consolidada'[Created at] <= MAX ( 'Base consolidada'[Created at] )
            && 'Base consolidada'[Name] = MAX ( 'Base consolidada'[Name] )
    )
)

Here is the output.

Capture.PNG

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
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.