Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be 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

Reply
Syndicate_Admin
Administrator
Administrator

Wrong annual cumulative total

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.

Consulta.jpg

1 ACCEPTED SOLUTION

Hi @Syndicate_Admin ,

 

I create a easy sample to have a test and explain more to you.

Autonomias:

1.png

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:

1.png

[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.

1.png

 

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.

 

View solution in original post

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

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:

1.png

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:

1.png

[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.

1.png

 

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.

 

VijayP
Super User
Super User

@Syndicate_Admin 

Whatever Scenario shown in above table is absolutely fine. The Total Aggregation value will always be equal to the final cumulative value! 




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.