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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
santoshreddyk95
Frequent Visitor

Adding Row data in new Column

Hi All, 

 

I have a huge data base that has rows for every calendar date (almost 2 years of data) . I need the data of one calendar date in one column and other calendar date in other column while importing. so i can calculate the increase/decrease between two different dates. 

 

Any suggestions on how to di it?

Currently I am able to filter rows based on only one date using this

= Table.SelectRows(#"Removed Other Columns", each [calendar_date] = Date.From(Date.AddDays( DateTime.LocalNow(),-1)))

 

1 ACCEPTED SOLUTION

Hi @santoshreddyk95 

 

You want to calculate the increase/decrease between which two different dates? Every date and its previous date? If so, you can first duplicate the query.

vjingzhang_0-1652943746974.png

 

Then in the duplicated table, add a custom column to get the previous date. 

Date.AddDays([Date],-1)

vjingzhang_1-1652943932824.png

 

Then merge queries to bring data from the original table into the duplicated table. Hold on Ctrl key and select "Previous Date" & "Item" columns as matching columns in duplicated table. In the second table, select "Date" and "Item" columns. 

vjingzhang_2-1652944495637.png

 

Expand the merged table column and select "Inventory" to add to the duplicated table. 

vjingzhang_3-1652944873876.png

 

You can then calculate the difference between two inventory columns to get the daily decrease/increase amount. 

 

If you don't want to bring two tables' data into the data model, you can uncheck "Enable load" option for the original table. 

vjingzhang_4-1652945033780.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@santoshreddyk95 , Best is use a measure and time intelligence

 

example

This Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))


Last Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))

 

Last Day = CALCULATE(sum('Table'[Qty]), previousday('Date'[Date]))

 

diff =[This Day] - [Last Day]

Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Each Calendar day has 1000+ rows which are distinct. Kind of Inventory details. For every row item i need a difference. Increase in inventory for every material. 

Hi @santoshreddyk95 

 

You want to calculate the increase/decrease between which two different dates? Every date and its previous date? If so, you can first duplicate the query.

vjingzhang_0-1652943746974.png

 

Then in the duplicated table, add a custom column to get the previous date. 

Date.AddDays([Date],-1)

vjingzhang_1-1652943932824.png

 

Then merge queries to bring data from the original table into the duplicated table. Hold on Ctrl key and select "Previous Date" & "Item" columns as matching columns in duplicated table. In the second table, select "Date" and "Item" columns. 

vjingzhang_2-1652944495637.png

 

Expand the merged table column and select "Inventory" to add to the duplicated table. 

vjingzhang_3-1652944873876.png

 

You can then calculate the difference between two inventory columns to get the daily decrease/increase amount. 

 

If you don't want to bring two tables' data into the data model, you can uncheck "Enable load" option for the original table. 

vjingzhang_4-1652945033780.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors
Top Kudoed Authors