Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calendar multiple relations in one table not working

Hello All,

 

I have created a calendar table and have multiple date relationships with a single table. The table has an assigned date and a closed date for work orders. I want to show how many workorders are assigned and closed per month and per technician. To do this I created a column that had the number of work orders per ticket (1 order per ticket) and then created a measure called Total_WO (standing for total work orders). I tried to create a Total_WO_Assigned measure and a Total_WO_Closed measure using the following code:

Total_WO_Assigned = CALCULATE([Total_WO], USERELATIONSHIP('Calendar'[Date],tblWork_Orders[WO_AssignDate]))
Total_WO_Closed = CALCULATE([Total_WO],USERELATIONSHIP('Calendar'[Date],tblWork_Orders[WO_ClosedDate]))
 
I then tried to seperate this in a table to break it up by date and got:
Is there something I am doing wrong with the relationships? Any help would be appreciated I have been working with PowerBI for about a week now and have a lot to learn. Thank you.
 
Here is my relationship view:
 

4 Replies

  • Anonymous , I hope year date, and month are coming from the date table. They should be from date table

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak Yes, they are! If I would do it with the assign date or close date it will work but then I can no longer display them apporpriatly on the same table. I was hoping by using the date table I could display them on the same table