Forum Discussion

DebbieE's avatar
DebbieE
Community Champion
2 years ago
Solved

SAMEPERIODLASTYEAR bringing back current values

This has happened after working on  Solved: Re: KPIs visuals Running incredibly slowly - Microsoft Fabric Community   I have some DAX that is basically doing a distinct count on the person ID To...
  • Vallirajap's avatar
    2 years ago

    Hii DebbieE 

    Try this for the above senario,

     

    No Pupils Same Period Last Year = CALCULATE ( SUM(Total People),
       SAMEPERIODLASTYEAR('Dim Date'[Date].[Date]
    ))
     

    Did I answer your question?

    Mark my post as a solution, this will help others...!

    Hit the kudo also,

    Thank you

  • Ahmedx's avatar
    2 years ago

    ply try this

    m1 = 
    VAR _LastYear = MAX('Dim Date'[Year]) -1
    RETURN
    CALCULATE (
        SUMX (
            VALUES ( 'Dim Person'[Person ID] ),
            1
        ),
        'Dim Date'[Year] = _LastYear
    )