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 project a comparison between the parameter measure and the corresponding previous year measure depending on the field parameter selection?

 

TIA,

 

Ludvig Reck

  • 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

                           

1 Reply

  • ludvigreck's avatar
    ludvigreck
    Frequent Visitor

    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