Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

creating a table that adds rows by date of missing information from table2

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

3 REPLIES 3
mahoneypat
Employee
Employee

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





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Daviejoe
Memorable Member
Memorable Member

The below might help you create a table that houses the dates that are not present

 

https://community.powerbi.com/t5/Desktop/Consuming-only-updated-records-in-Power-query/m-p/726938/hi...

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

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.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.