Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I am having a complicated problem. Say I have two tables. The first one with a list of equipment like this:
Table 1
~~~~~~~~~~~~~~~~~~~~~~
Equipment 1
Equipment 2
Equipment 3
~~~~~~~~~~~~~~~~~~~~~~~
And I have another table with the equipment name and the dates it was checked, like this:
Table 2
~~~~~~~~~~~~~~~~~~~~~~~~~~
Equipment 1 | 05/02/2020
Equipment 2 | 05/08/2020
Equipment 1 | 04/05/2020
Equipment 3 | 04/01/2020
~~~~~~~~~~~~~~~~~~~~~~~~~~
And I want to create a new table where it compares the two and makes a new table of the equipment missed with the month it was missed, kind of like this.
Table 3
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Equipment 3 | 05/2020
Equipment 2 | 04/2020
~~~~~~~~~~~~~~~~~~~~~~~~~~~
How could I do this, I have tried creating this in data view, but it is missing the dates and only shows the equipment missed through the entire database, also it doesnt filter right. I think the best way for my purposes may be to do it in query. So that when I update my import it modifies the new table automatically. Any help would be greatly appreciated, I am at my wits end on this.
Taylor
Here is one way to approach this one
1. Add a custom column to your first table with a list of all the year/months in scope (you can auto generate that with List functions or use a source file)
2. Expand that list to new rows, so you get the combination of all year/months and equipment IDs
3. Add a custom column to your second table that convert your Date to the same YearMonth format as you created in step 1
4. Do a left join of table 2 into table1 (join on Equipment ID and on Year/Month)
5. Expand the table 2 table any of the columns
6. Filter out any non-null rows to get your desired result
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
The below might help you create a table that houses the dates that are not present
Proud to be a Super User!
not quite what i am looking for. I am wanting to take the test data and populate a table with the equipment missing for the month on a new table. I am wanting to do that for every month.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |