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 have a clustered bar chart on which I grouped the sum of my sales by month. I am using the Date Hierarchy of my date column. I would like to add a bar per month that represents a current total: the sum of that month and previous months, which resets to 0 each December. I have found several pieces of code in the forum but each time it is necessary to remove the DateHierarchy and I therefore end up with a bar per sale, and not a group by month.
How can I do this?
At the moment I have this :
and I would like something like this :
I hope you'll see the idea
I can't calculate a new column direcly because these are the sales filtered by saler and this filter is applicated on the dashboard
Thank you
Solved! Go to Solution.
Hi @MasTristan ,
I created some data:
Here are the steps you can follow:
1. Enter data – create table.
2. Create measure.
Value1 =
SUMX(FILTER(ALL('Table'),
'Table'[Year]=MAX('Table'[Year]) && 'Table'[Month]=MAX('Table'[Month])),[Value])
Value2 =
SUMX(FILTER(ALL('Table'),
'Table'[Year]=MAX('Table'[Year]) && 'Table'[Month]<=MAX('Table'[Month])),[Value])
Group_Value =
IF(
MAX('Table2'[Group]) ="that month",[Value1],[Value2])
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @MasTristan ,
I created some data:
Here are the steps you can follow:
1. Enter data – create table.
2. Create measure.
Value1 =
SUMX(FILTER(ALL('Table'),
'Table'[Year]=MAX('Table'[Year]) && 'Table'[Month]=MAX('Table'[Month])),[Value])
Value2 =
SUMX(FILTER(ALL('Table'),
'Table'[Year]=MAX('Table'[Year]) && 'Table'[Month]<=MAX('Table'[Month])),[Value])
Group_Value =
IF(
MAX('Table2'[Group]) ="that month",[Value1],[Value2])
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
The only problem here is that it doesn't seems like the result is filtered by employee but for the rest it is ok so thanks
Did you try YTD function to achive that?
Proud to be a Super User!
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 |
---|---|
105 | |
96 | |
79 | |
67 | |
62 |
User | Count |
---|---|
137 | |
105 | |
104 | |
80 | |
63 |