Forum Discussion

Bluefire's avatar
Bluefire
Regular Visitor
6 years ago
Solved

Filtering in a historized table

Hello guys,   I am sorry to bother you with this question, but as i am fairly new to Power BI i dont really have a clue on how to proceed. The situation is as follows: i have a historized table whe...
  • v-xuding-msft's avatar
    6 years ago

    Hi Bluefire,

     

    You could drag the column "Valid From4" into slicer to filter your date.  Or you can create a date table and use a measure to achieve your purpose.

    The details are as follows:

     

    Firstly, you can create a Calendar table which contains all continued date :

     

    1. Click New table in Modeling Tab

     

    1. Create a date table as below:
    Date = CALENDAR(MIN('Table'[Valid From4]),MAX('Table'[Valid To5]))

     

    1. Use a Slicer, you may choose list, because it is convenient to select a specific values

     

    1. Find New Measure on Home Tab:

     

    Create a Measure like below:

    Measure =
    var selectedvalue = SELECTEDVALUE( 'Date'[Date])
    var a = CALCULATE(MAX('Date'[Date]),FILTER('Date',selectedvalue >= MAX('Table'[Valid From4]) && selectedvalue < MAX('Table'[Valid To5])))
    return
    IF(ISFILTERED('Date'[Date]),a)
    1. Add the Measure into the table value. If the date is between From4&To5, it will appear in Measure Column, when you select a date in Slicer.