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,
There is a fact table with contract date as starDate and EndDate as
Id | investment | ResidualValue | start_date | End_date |
21 | 100 | 50 | 1/1/2021 | 04/06/23 |
22 | 300 | 60 | 1/1/2022 | 1/1/2023 |
Need to calculated Exposure for every day inbetween (star and endate). For this measure i have created a custom colum for each record (in between start and end date), but problem the table become huge for each record n taking long time load. So is there any way create each record of date in Dax or measure exposure from date dimension. the calculation (exposure is )= remaining days of contract /total duration * (investment-residual value). Where total duratio is just subtraction of end_date and start_date and Remining days is contact is substraction of each_date (that would like create as calculate column or measures in Dax ) and start_date.
Thanks in advance.
BR
mmh
Solved! Go to Solution.
Try
Exposure =
VAR MaxDate =
MAX ( 'Date'[Date] )
VAR Exposure =
CALCULATE (
SUMX (
'Table',
VAR StartDate = 'Table'[start date]
VAR EndDate = 'Table'[end date]
VAR Investment = 'Table'[investment]
VAR ResidualValue = 'Table'[residual value]
VAR TotalDuration =
INT ( EndDate - StartDate )
VAR RemainingDays =
INT ( EndDate - MaxDate )
RETURN
DIVIDE ( RemainingDays, TotalDuration ) * ( Investment - ResidualValue )
),
'Table'[start date] <= MaxDate
&& 'Table'[End date] >= MaxDate
)
RETURN
Exposure
Hi John,
Thanks. It worked exactly as per my expectation
Try
Exposure =
VAR MaxDate =
MAX ( 'Date'[Date] )
VAR Exposure =
CALCULATE (
SUMX (
'Table',
VAR StartDate = 'Table'[start date]
VAR EndDate = 'Table'[end date]
VAR Investment = 'Table'[investment]
VAR ResidualValue = 'Table'[residual value]
VAR TotalDuration =
INT ( EndDate - StartDate )
VAR RemainingDays =
INT ( EndDate - MaxDate )
RETURN
DIVIDE ( RemainingDays, TotalDuration ) * ( Investment - ResidualValue )
),
'Table'[start date] <= MaxDate
&& 'Table'[End date] >= MaxDate
)
RETURN
Exposure
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 |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |