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.
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 at | Name | Count | Cumulative |
01/05/2019 | A | 1 | 1 |
02/05/2019 | A | 1 | 2 |
03/05/2019 | A | 1 | 3 |
04/05/2019 | B | 1 | 1 |
02/05/2019 | B | 1 | 2 |
03/05/2019 | B | 1 | 3 |
03/05/2019 | B | 1 | 4 |
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!
Solved! Go to Solution.
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.
Best Regards,
Cherry
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
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.
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.
Best Regards,
Cherry
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
99 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |