Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I have one table for valuaions ('Valuations') that looks like the following:
ValID | Property | ValDate | Valuation |
1 | 1 | 31/12/2017 | 1,000,000 |
2 | 2 | 31/12/2017 | 1,500,000 |
3 | 3 | 31/12/2017 | 2,000,000 |
4 | 1 | 31/12/2018 | 1,000,000 |
5 | 2 | 31/12/2018 | 1,500,000 |
6 | 3 | 31/12/2018 | 2,000,000 |
7 | 1 | 31/12/2019 | 1,500,000 |
8 | 2 | 31/12/2019 | 1,750,000 |
9 | 4 | 31/12/2019 | 2,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
Solved! Go to Solution.
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:
Link to file here.
Hope this helps. Please mark as solution if this is what you were looking for.
Kind regards, Steve.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
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:
Link to file here.
Hope this helps. Please mark as solution if this is what you were looking for.
Kind regards, Steve.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |