Forum Discussion

PowerBIkalaimo's avatar
7 years ago

1 date slicer, 2 dates on same table

New to Power BI. Basically, I have a table with: incident type, incident location, incident occur date.  I have a date table linked to incident occur date and a slicer on the report that uses the date table to slice by occur date. This all works. I wanted to show "same time last year" data on the report. So I created a calculated column occur date 2, which I added 365 days to occur date.  My thought being, link occur date and occur date 2 to the same date slicer, and when someome say picks "1/1/2019' in the slicer, they will see incidents with occur date 1/1/2019 as "Selected Date Range Incidents"  and 1/1/2018 occur date incidents (which have an occur date 2 of 1/1/2019) as "Prior Years Date Range Incidents".

But, I can't get an active relationship to the date table for occur date 2 because occur date is active. 

So I'm not sure how to accomplish what I want to accomplish - 1 date slicer that no matter which date range you pick, you see "Selected Date Range Incidents" in 1 visual, and "Prior Years Date Range Incidents" in a 2nd visual?  How can I use 1 date slicer to slice 2 different date fields on the same table (occur date and occur date 2)?  OR - how else can I accomplish what I want to do?

Thanks for your help!

1 Reply

  • v-lili6-msft's avatar
    v-lili6-msft
    Icon for Community Support rankCommunity Support

    hi, PowerBIkalaimo 

    You could Unpivot columns in Edit Queries, select two date column and then click Transform->Unpivot column

    Then create the relationship with new date column and then drag Attribute column as legend.

     

    Best Regards,

    Lin