Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Use one date table

Hi everyone,

 

I`ve using power bi since one year, and i cant solved this.

I need to have one table of dates in order tu use that table to filter many other tables.

The thing is that i cant make a relationship between two tables (which have a relationship between) with the table Date.

 

For example:

 

I have this tables:
Employees (ID)
Employees Trainings (employeeID)
Date

 

I want to relation Training Date with Date table and Employees Entry Date with Date table.

So when i show in a same page the trainings and new employees, i want to filter all dat with a same filter of year or month for example.

 

Thanks in advace.

Regards

7 Replies

  • Anonymous what is the issue? if you have inactive relationship between employee and date table, you can make it active using USERELATIONSHIP function.

     

    For example, the following measure will count the employees and if you use this measure, you will able to get the count based on date slicer.

     

    Count Employees = 
    CALCULATE ( COUNT ( EmployeeTable ), USERELATIONSHIP ( EmployeeTable[Date], DateTable[Date] ) )

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    I'm sorry I'm not clear about your requirement... Could you please provide some sample data in these three tables and your desired result? Whether the relations among them be set same with the one in below screen shot?

    Relationship

    Desired result??

    Best Regards

    Rena

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous 

       

      What i see in your example is that you cant slicer both tables. Employee entry date and training date.

      That is my problem.

       

      I want in the same page, to use a slicer from "Date table" which allows me to filter both tables.


      As you show, one relation is inactive.
      If i use the function "Use relationship" it will work only for that count

      Thanks

      • jthomson's avatar
        jthomson
        Solution Sage

        I'm confused as to what you're actually trying to do here - I can get you want to look at all employees that started in, say, 2019, that's fine. I can get you'd want to look at all training that was done in, say, 2020, that's fine, but I can't really think of any sensible use to use a single slicer here unless you're wanting to say "I want to see all training done in 2019 by employees that started in 2019". Really think that any use for this sort of thing would use two slicers - what exactly do you want to do with just one slicer?