March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello, a favor, I am using the DATESYDT function but in a couple of tables it is not recognizing the annual cumulative sum.
What could be registering wrong?
Thank you.
Solved! Go to Solution.
Hi @Syndicate_Admin ,
I create a easy sample to have a test and explain more to you.
Autonomias:
Calendar:
Calendar =
ADDCOLUMNS (
CALENDAR ( DATE ( 2021, 01, 01 ), DATE ( 2021, 03, 31 ) ),
"Month", MONTH ( [Date] ),
"MonthName", FORMAT ( [Date], "MMM" )
)
Measures:
Locales = DISTINCTCOUNT(Autonomias[Locales])
Locales acumulado = CALCULATE([Locales],DATESYTD('Calendar'[Date]))
Result:
[Locales] measure will distinctcount locales for each Month, and the total is distinctcount for all month = 4.
You create [Locales acumulado] by DATESTYD, so Jan will distinctcount locals for Jan (A C A) =2, Feb will distinctcount locals for Jan and Feb (A C A, A B C) = 3, Total will distinctcount locals for whole year = 4. There is only distinctcount and no sum. So the result is correct.
If you want to calculate acumulate distinct locals , create a virtual table and try sumx function.
New_Locales acumulado =
VAR _SUMMARIZE =
SUMMARIZE (
ALL ( 'Calendar' ),
'Calendar'[MonthName],
'Calendar'[Month],
"Locals", [Locales]
)
RETURN
SUMX ( FILTER ( _SUMMARIZE, [Month] <= MAX ( 'Calendar'[Month] ) ), [Locals] )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello, well adding freehand it is clearly seen that it is not right, neither the total nor the accumulated.
Hi @Syndicate_Admin ,
I create a easy sample to have a test and explain more to you.
Autonomias:
Calendar:
Calendar =
ADDCOLUMNS (
CALENDAR ( DATE ( 2021, 01, 01 ), DATE ( 2021, 03, 31 ) ),
"Month", MONTH ( [Date] ),
"MonthName", FORMAT ( [Date], "MMM" )
)
Measures:
Locales = DISTINCTCOUNT(Autonomias[Locales])
Locales acumulado = CALCULATE([Locales],DATESYTD('Calendar'[Date]))
Result:
[Locales] measure will distinctcount locales for each Month, and the total is distinctcount for all month = 4.
You create [Locales acumulado] by DATESTYD, so Jan will distinctcount locals for Jan (A C A) =2, Feb will distinctcount locals for Jan and Feb (A C A, A B C) = 3, Total will distinctcount locals for whole year = 4. There is only distinctcount and no sum. So the result is correct.
If you want to calculate acumulate distinct locals , create a virtual table and try sumx function.
New_Locales acumulado =
VAR _SUMMARIZE =
SUMMARIZE (
ALL ( 'Calendar' ),
'Calendar'[MonthName],
'Calendar'[Month],
"Locals", [Locales]
)
RETURN
SUMX ( FILTER ( _SUMMARIZE, [Month] <= MAX ( 'Calendar'[Month] ) ), [Locals] )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Whatever Scenario shown in above table is absolutely fine. The Total Aggregation value will always be equal to the final cumulative value!
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
90 | |
90 | |
66 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
70 | |
68 |