Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Previous month data and Current month data as Two separate tables

Hello, 

I am a bit new to PowerBI, don't know much about M for PowerQuery. 

I am trying to pull in data from a DB to produce automated metrics that are currently manual. One of the requirements for these metrics is that I have to compare the data from this month to last month. The current method has two exports of the data that comprises of current month export and previous month export.

 

Is there a way to replicate the above of having two different exports from the DB using PowerBI? I tried looking into Incremental refreshes but that seems to just update and add versus what Im looking for which is a complete table of the previous months' data and another table for the current month. Also, this is planned to be refreshed automatically, in case that peice of information is important and I am not able to alter the DB.

Please advise and Thank you.

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello,

    I don't think that the data itself is necessary. Also, its very sensitive data, so I've sponged it a lot. This probably does not help, but you can use any data you want, to reiterate, I am looking to pull this data from a Database and have two instances of it. One instance that has data from a previous month and one that has data from the current month. So the table below would be this months data, and previous months data would be the same except Last Seen would be from 5/8/2022.

    I.D.Operating SystemIPTypeCategoryStatusFirst SeenLast Seen
    1RedhatnullServerRecurringActive1/5/20226/8/2022
    2WindowsnullServerRecurringActive1/6/20226/8/2022
    3WindowsnullServerRecurringActive1/5/20226/8/2022
    4RedhatnullServerCompleteActive1/6/20226/8/2022
    5CentOSnullServerRecurringActive1/6/20226/8/2022
    6RedhatnullServerRecurringActive1/5/20226/2/2022
    7WindowsnullServerRecurringActive1/6/20226/8/2022
    8WindowsnullServerRecurringActive1/6/20226/8/2022
    9RedhatnullServerRecurringInactive1/5/20226/5/2022
    10CentOSnullServerCompleteInactive1/6/20226/8/2022

     

    My idea was to create a separate blank query (Prev Table)  that copies the Main tables data. So when it comes time to pull in the new data, I would refresh the Prev Table to pull the data that is currently in the Main table that is currently out of date, then I would refresh the main table to pull in this months new data.

    Another idea was possible a history table with summarized data? So I would create a new table that captured the current month that its capturing, sum of total rows in this months, and number of active servers (This is ultimately the data I need for the metrics). And with every refresh it would add in a row or at the very least, from the previous month.

    • lbendlin's avatar
      lbendlin
      Icon for Super User rankSuper User

      Power BI has no memory. You need to store your snapshots in your upstream system.

      • Anonymous's avatar
        Anonymous
        Not applicable

        By Upstream System, do you mean the DB that I am pulling from?