Forum Discussion

Kristaps's avatar
Kristaps
Frequent Visitor
2 years ago

Two slicers with duplicate values

 

I wanted to use two slicers where one is for ‘’Session date’’ and the other one is for ‘’Drill name’’. So for example I want to set the first slicer on 01/012024 (date) and then in the other slicer I would choose which drill I want to show on columns. 

 

But I ran into problem when I refreshed that in the data I have duplicate values for the same date.

 

What could I do to sort this problem, and be able to switch the date and then in other slicer choose drill name on the same date? 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Kristaps 

     

    According to the error message, I suggest you to remove the primary key of the "Session ID" column.

     

    If your dataset allows, consider creating a new column in your data model that combines the "Session date" and "Drill name" into a unique identifier.

     

    This can be done using Power Query or DAX, depending on your preference. This unique identifier can then be used in your slicers to ensure that each combination of date and drill name is unique.

     

    Regards,

    Nono Chen

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

    • Kristaps's avatar
      Kristaps
      Frequent Visitor

      Thanks,

      I tried, but I don't know how to remove primary key of "session ID" column.

      Can you help me on how to do that? 

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Kristaps 

         

        You need to go to the database and change the primary key.

         

        Regards,

        Nono Chen