Forum Discussion

pezakas's avatar
pezakas
Helper I
3 years ago

Showing data while dataset is filtered

Hello community,

This is my dataset. 

The user always picks a date from a single selection slicer, that is using the "Dataflow_Date".
I would like to create a measure so that when user select's the 31/1 of each year, he can see the SUM of effort in the previous year.

Thanks in advance!

6 Replies

  • NaveenGandhi's avatar
    NaveenGandhi
    Memorable Member

    Hello pezakas 

    Your question is bit confusing. You want sum of effort of previous year when user selects 31/1. That would look like below in a table visual. What would you want to see when user selects 28/2?

     

    31/1 selected:

    Project IDEffort(MDs)Dataflow_Date
    ID0011231/01/2023(sum of effort of 2022)
    • pezakas's avatar
      pezakas
      Helper I

      When user selects 28/02 , he should see the effort as of 31/01 of the same year.

      • NaveenGandhi's avatar
        NaveenGandhi
        Memorable Member
         
        pezakas 

        Try the below measure.

        Effort PRevious =
        VAR Prev_=
        IF (
        MONTH ( MAX ( Effort[Dataflow_Date] ) ) = 1,
        CALCULATE (
        SUM ( Effort[Effort(MDs)] ),
        ALL ( Effort ),
        PREVIOUSYEAR ( Effort[Dataflow_Date] )
        ),
        CALCULATE (
        SUM ( Effort[Effort(MDs)] ),
        PREVIOUSMONTH ( Effort[Dataflow_Date] )
        )
        )
        RETURN
        Prev_

         

        Let me know if this helps.

         

        Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!