Forum Discussion

dansta87's avatar
dansta87
Frequent Visitor
2 years ago
Solved

Merge and Collate Data correctly

Hi,

 

I am fairly new to PowerBI and ive been struggling to try and get the correct data, i feel like i am going in the right direction but i need some assistance.

 

I have a Data Query that pulls the following data from an SQL Server:

ITEMDATEUSEDDATERETURNEDUSEDBY
ITEM 12024-01-012024-01-02PERSON1
ITEM 22024-01-032024-01-10PERSON2
ITEM 32022-10-012023-10-01PERSON3

 

I also have a custom CALENDARAUTO table that i use for date selecting via a slicer.

 

I would like to be able to select a day or range of days using the slicer and then show when an item has or hasnt been used over that period, and if a particular item has not been used then i would like it to be shown with no data.
(DATEUSED and DATERETURNED are inclusive).

 

e.g. Output (if i select the date range 2024-01-01 - 2024-01-03)

DATEITEM1ITEM2ITEM3
2024-01-01PERSON 1  
2024-01-02PERSON 1  
2024-01-03 (and so on) PERSON 2 

 

I have tried going down the path of a merge query to merge the calendar table with the data table to get a combined table but it is only showing rows where data exists.

 

I dont know if what i wasnt is even possible, please can someone assist?

 

Thanks

10 Replies

  • dansta87's avatar
    dansta87
    Frequent Visitor

    This is amazing, thank you.

     

    I've come across a few potential issues with this method though.

     

    There are a total of around 600+ items, meaning that each item needs to be manually added to the table as a column, and new items will also have to be manually added.

    - Ive tried merging these into their own table so it can be used for filtering etc, however again each column needs to be typed manually to merge?

     

    • Ahmedx's avatar
      Ahmedx
      Super User

      show me what your table looks like so I can understand what you need

      • dansta87's avatar
        dansta87
        Frequent Visitor

        Thank You.

        This is essentially the output table i am trying to get:

         

         

        With the ability to filter on the item.
        But if each ITEM is added as its own column, would i need to aggregate all of these columns into a single column so that i can filter them?