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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Diff with previous date

Hi guys!

Can't get my new column or measure to calculate the value in column  "PrevRows" in Power Bi.

I want to show the customer how tables grow in the databse between the dates.

 

Hope you can help me out with solving  that.

 

ReportDateTableCount of rowsWhat report
2017-03-01Table110PrevReport
2017-03-01Table2210PrevReport
2017-04-20Table130ThisReport
2017-04-20Table2235ThisReport

 

And I need to calculate this 

PrevRowsDiff
  
  
1020
21025

 

Regards

Tobias

1 ACCEPTED SOLUTION
Anonymous
Not applicable

6 REPLIES 6
Greg_Deckler
Community Champion
Community Champion

Diff = CALCULATE(SUM([Count of rows]),FILTER(Table,[What report] = "ThisReport")) - CALCULATE(SUM([Count of rows]),FILTER(Table,[What report] = "PrevReport"))

Put Table column and this measure into a table.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Reid_Havens
Most Valuable Professional
Most Valuable Professional

Hi Tobias,

 

You should be able to accomplish this using a DAX Measure or in Power Query. First question. Are the columns "Table" and "What Report" actual columns in the table output? Second question if yes, are the table names or report names fixed or do they change? If they are columns, and they're fixed names. Then you should be able to use two CALCULATE queries for each, and just find the difference between the values.

Anonymous
Not applicable

- Column "table" is. I have added column "What report" when tried to solve this.

- The reason for the column "What report" is to have a fixed value.
  (Column "What report" is defind in a related table "Report_tbl", with column "Date","What report")

- The table names are not fixed, it is the top 10 tables in customer database.

Reid_Havens
Most Valuable Professional
Most Valuable Professional

 Ok so this is helping me consider the right direction. My next question then, so for the "current" or "previous report flags, how many distinct table names would be under a distinct date? If it's always two you could use FIRST/LAST NONBLANK functions to call those rows when calculating current or previous report counts. If it's more than two then we'd need to figure out how to find each distinct table name and compare the count values with the current and previous dates.

Anonymous
Not applicable

Thanks for your help.
I have solved it after reading this (https://community.powerbi.com/t5/Desktop/Find-value-for-first-and-last-date-by-person/m-p/62016).

Regards
Tobias

Anonymous
Not applicable

The table can only exist one time for "Current" and one time for "Previous". 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors