Forum Discussion

ludvigreck's avatar
ludvigreck
Frequent Visitor
2 years ago
Solved

Field parameter comparison

Hello,   I have three measures in a field parameter slicer:  Production Production per hour Occupancy rate   I also have three corresponding measure with sameperiodlastyear()   How can I pro...
  • ludvigreck's avatar
    2 years ago

    Solved it with calculation items and used it as legend

    CY = SELECTEDMEASURE ()

    PY = CALCULATE (

                   SELECTEDMEASURE ( ),

                           SAMEPERIODLASTYEAR ( Date[Date] ),

                                Date[IsPast] = TRUE ( )

    )

     

    Where Date[IsPast] is a calculated column with the following properties:

    VAR LastSaleDate = MAX ( 'Sales'[SalesDate] )
    VAR LastSaleDatePY = EDATE ( LastSaleDate, -12 )
    RETURN
        'Date'[Date] <= LastSaleDatePY