The goal is to fill up blanks with previous values.
Thankful to @Alexis Olson
I was able to achieve this for development year.
Post can be found here:
How to fill out blanks in Running Total matrix Power BI
But now I need the same for development month
and this is where I stuck.
What I've done:
--created calculated table 'Dev Months'
that retrieves all development months.
--tried to modify expression by manipulating Dem Month
Accident Month Losses1 =
VAR CurrDevMonth = MAX('Dev Months'[DevMonth])
VAR MaxMonth = CALCULATE(MAX(fact_Losses[AccidentMonth]), ALLSELECTED(fact_Losses))
VAR CurentMonth = MAX(fact_Losses[AccidentMonth])
VAR CurentYear = MAX(fact_Losses[AccidentYear])
RETURN
IF(
MONTH(
EOMONTH(
DATE(CurentYear - 1,12,31),
CurrDevMonth)
) > MaxMonth,
BLANK(),
CALCULATE(
SUM(fact_Losses[PaymentAmount]),
FILTER(ALL(fact_Losses[DevMonth]), fact_Losses[DevMonth] <= CurrDevMonth)
)
)
--Tried to use AccidentDate
and break it down by Year
and Month
--Tried to convert Year-Month
to DATE
Still no success
Data looks like this:
When I use matrix to display data I have blanks.
Columns: Month-Year,
Rows: Development months. Can be more than 12 since its developing over time.
Values: Running total
If there is a blank (no loss) then it should be populated with previous number, based on development month.
Running Total Dax expression :
Accident Month Losses =
CALCULATE(
[Total Loss],
FILTER(ALL(fact_Losses[DevMonth]),fact_Losses[DevMonth] <= MAX(fact_Losses[DevMonth])
))
Need to be like this:
.pbix can be found here: https://www.dropbox.com/s/zujp6p9lbyqfez7/Test_LossTriangle.pbix?dl=0
Please help