Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
Is it possible to create such bartchart? The measure from which this needs to be calculated is not necessary now - could be Sum of Sales
Solved! Go to Solution.
Hi @Pbiuserr ,
Please create a separate Dates table and use the following measure.
SumValues =
VAR CurrentYear =
YEAR ( MAX ( Dates[Date] ) )
VAR _YTD =
CALCULATE ( SUM ( 'Table'[Values] ), DATESYTD ( 'Calendar'[Date] ) )
VAR YearEnd =
IF ( MAX ( 'Calendar'[Date] ) = ENDOFYEAR ( 'Calendar'[Date] ), _YTD )
RETURN
IF (
MAX ( 'Calendar'[Date] ) = MAX ( Dates[Date] ),
CALCULATE (
_YTD,
FILTER ( 'Calendar', 'Calendar'[Date] <= MAX ( Dates[Date] ) )
),
IF (
YEAR ( MAX ( 'Calendar'[Date] ) ) >= CurrentYear - 2
&& YEAR ( MAX ( 'Calendar'[Date] ) ) < CurrentYear,
YearEnd
)
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Pbiuserr ,
Please create a separate Dates table and use the following measure.
SumValues =
VAR CurrentYear =
YEAR ( MAX ( Dates[Date] ) )
VAR _YTD =
CALCULATE ( SUM ( 'Table'[Values] ), DATESYTD ( 'Calendar'[Date] ) )
VAR YearEnd =
IF ( MAX ( 'Calendar'[Date] ) = ENDOFYEAR ( 'Calendar'[Date] ), _YTD )
RETURN
IF (
MAX ( 'Calendar'[Date] ) = MAX ( Dates[Date] ),
CALCULATE (
_YTD,
FILTER ( 'Calendar', 'Calendar'[Date] <= MAX ( Dates[Date] ) )
),
IF (
YEAR ( MAX ( 'Calendar'[Date] ) ) >= CurrentYear - 2
&& YEAR ( MAX ( 'Calendar'[Date] ) ) < CurrentYear,
YearEnd
)
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @Pbiuserr ,
So it is cumulative sum for each year. In 2020, you will add the total for that complete year. Similarly you will add cumulative sum for 2021 and 2022 (upto current month.
Then you would show this on the bar chart.
If I understand correct, then this is quite simple if you use a date table. Use year column of date table on x axis, it will automatically sum the total for that year.
Please confirm if this understanding is correct or I missed out something on your requirement.
Hi,
Well technically you're right, however I think users (so the business) would like to see labels like Dec 2020, Dec 2021, April 2022 and thats where is becomes tough
also - if user select November 2021, then 2021 value would be measured up to November (2020, 2021 and 2022) or entire year (december included) ? If only till november, how to make it measure up till end of year? Give filter in measure calculation ENDOFYEAR(Calendar[Date]) ? Slicer must be Month-Year
Hello @Pbiuserr ,
Can you please elaborate a bit about x axis labels? Other than what they are, if you also add A short sample of figures, that would be helpful to understand and try a solution!
The measure I'll use is sort of cumulative, so my goal is to compare Current selection, with End of the Year for previous year and end of the year -2 from current selection
Labels on axis would be (considering if I choose May 2022).
December 2020, December 2021, May 2022
is it something achieveable?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
124 | |
79 | |
49 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |