Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Display First and Last date based on two week index

I currently have an index column on my Date table that counts the amount of pay periods passed since the first of the year. Each pay period is two weeks. So from 1/1/2020 to 1/14/2020 the payroll ind...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    Please try to use the what-if parameter. You can interact with the variable as a slicer, and visualize and quantify different key values in your reports.

    Here's my solution.

    First, I created the Payroll Index from Jan20 on my own way.

     

    Then, create a what-if parameter on the Modeling tab.

    Set your own parameters according to your needs, here my maximum value is set to 26.

    You can get a slider and a calculated table.

    Create a relationship between two tables, then you can filter through the slider.

     

    Now you can create a measure to get the text "1/1/2020 - 1/14/2020" to be displayed when the slider is selected to 0.

     

     

    Measure = MIN('Calendar'[Date])&"-"&MAX('Calendar'[Date])

     

     

    Reference: Use what-if parameters to visualize variables - Power BI | Microsoft Docs

    You can check more details from my attachment.

     

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.