Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
4 years ago

That cumulative sum graph does not show value if it does not correspond

Good morning, I need to make a daily sales sum graph of the current month compared to the previous year, but I need you to only show me until the current day of the current month and not repeat the value of the sum until the last day.

francogh_0-1648638228183.png

This is the code I use.

Spoiler
Cumulative 2022 = CALCULATE([TOTAL my 2022],
FILTER(ALLSELECTED('412 - DIARIES'),'412 - DIA'[DIA] <= MAX('412 - DIA'[DIA]
)))

3 Replies

  • Hi Anonymous ,

     

    Try to use the following measure:

     

    Cumulative 2022 =
    CALCULATE (
        [TOTAL my 2022],
        FILTER (
            ALLSELECTED ( '412 - DIARIES' ),
            '412 - DIA'[DIA] <= MIN ( TODAY (), MAX ( '412 - DIA'[DIA] ) )
        )
    )
    • Syndicate_Admin's avatar
      Syndicate_Admin
      Icon for Administrator rankAdministrator

      Thanks for the reply, it appears the same way using that code.

      francogh_0-1648644483401.png

      • MFelix's avatar
        MFelix
        Icon for Super User rankSuper User

        Hi Anonymous ,

         

        You want the value to be blank when is higher than today is that it?

         

        Try the following code:

         

        Cumulative 2022 =
        IF (
            SELECTEDVALUE ( '412 - DIA'[DIA] ) <= TODAY (),
            CALCULATE (
                [TOTAL my 2022],
                FILTER (
                    ALLSELECTED ( '412 - DIARIES' ),
                    '412 - DIA'[DIA] <= MAX ( '412 - DIA'[DIA] )
                )
            )
        )