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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
TCC
Regular Visitor

Like for Like Increases / Filtered Table Comparisons / Start and End Values

Hi,

 

I have one table for valuaions ('Valuations') that looks like the following:

 

ValIDPropertyValDateValuation
1131/12/20171,000,000
2231/12/20171,500,000
3331/12/20172,000,000
4131/12/20181,000,000
5231/12/20181,500,000
6331/12/20182,000,000
7131/12/20191,500,000
8231/12/20191,750,000
9431/12/20192,500,000

 

In my report I have applied a slicer linked to a related 'Calendar' table to filter the visuals on my report by date.

 

I would like to create a measure that determines the opening value at the ealiest date of the slicer of those assets still held at the latest date of the slicer.

 

E.g. If the date range on the slicer is 31/12/2017 - 31/12/2019 I would like the measure to return 2,500,000 (the sum of the values for properties 1 & 2 which are the only ones which have valuations on 31/12/2019 that also had valuations on 31/12/2017.

 

I have tried creating a VAR of the filtered 'Valuations' table at each date, lookups and various other ways of "checking the start value of the properties which are still held at the latest date".

 

Any help would be much appreciated.

 

Thanks

1 ACCEPTED SOLUTION
stevedep
Memorable Member
Memorable Member

Hi,

 

I think you are looking for this:

 

SumOfMultiple = 
var v_min = MIN('Date'[Date])
var v_max = MAX('Date'[Date])
var tbl = FILTER(ALL('Table');'Table'[ValDate]= v_min || 'Table'[ValDate]= v_max) // both have entries on min or max date
var tbl_s = SUMMARIZE(tbl; 'Table'[Property];  "c"; COUNT('Table'[ValDate]); "firstval"; CALCULATE(SUM('Table'[Valuation]);'Table'[ValDate]=v_min)) //count entries for property
var ct = CALCULATETABLE(FILTER(tbl_s;[c]>1))

return
SUMX(ct;[firstval])

 

 

Giving:

like.png

Link to file here.

 

Hope this helps. Please mark as solution if this is what you were looking for.

 

Kind regards, Steve. 

View solution in original post

1 REPLY 1
stevedep
Memorable Member
Memorable Member

Hi,

 

I think you are looking for this:

 

SumOfMultiple = 
var v_min = MIN('Date'[Date])
var v_max = MAX('Date'[Date])
var tbl = FILTER(ALL('Table');'Table'[ValDate]= v_min || 'Table'[ValDate]= v_max) // both have entries on min or max date
var tbl_s = SUMMARIZE(tbl; 'Table'[Property];  "c"; COUNT('Table'[ValDate]); "firstval"; CALCULATE(SUM('Table'[Valuation]);'Table'[ValDate]=v_min)) //count entries for property
var ct = CALCULATETABLE(FILTER(tbl_s;[c]>1))

return
SUMX(ct;[firstval])

 

 

Giving:

like.png

Link to file here.

 

Hope this helps. Please mark as solution if this is what you were looking for.

 

Kind regards, Steve. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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