Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Current model can show data as below
what happen here is when the date is selected, all months' end values shown prior to selected month and last row shows the selected month value up to selected date. It was achieved by following measure
Target measure =
VAR selectedYear_ = SELECTEDVALUE ( AuxDates[Year] )
VAR selectedYM_ = SELECTEDVALUE ( AuxDates[Year MonthNr] )
VAR selectedDate_ = SELECTEDVALUE ( AuxDates[Date] )
VAR currentYear_ = SELECTEDVALUE ( Dates[Year] )
VAR currentYM_ = SELECTEDVALUE ( Dates[Year MonthNr] )
VAR currentDate_ = SELECTEDVALUE ( Dates[Date] )
RETURN
IF (
currentYear_ = selectedYear_,
SWITCH (
TRUE (),
currentYM_ < selectedYM_,
IF (
EOMONTH ( currentDate_, 0 ) = currentDate_,
CALCULATE ( SUM ( Target[Amount] ), Target[Product] IN { "FD", "1", "2", "3" } )
),
currentYM_ = selectedYM_,
IF (
currentDate_ = selectedDate_,
VAR totalTargetMonth_ =
CALCULATE (
SUM ( Target[Amount] ),
Dates[Date] = EOMONTH ( currentDate_, 0 ),
Target[Product] IN { "FD", "1", "2", "3" }
)
VAR totalWDaysInMonth_ =
CALCULATE (
SUM ( Dates[Working Day] ),
Dates[Year MonthNr] = currentYM_,
ALL ( Dates )
)
VAR totalWDaysInPeriod_ =
CALCULATE (
SUM ( Dates[Working Day] ),
Dates[Year MonthNr] = currentYM_,
Dates[Date] <= currentDate_,
ALL ( Dates )
)
VAR ratio_ =
DIVIDE ( totalWDaysInPeriod_, totalWDaysInMonth_ )
RETURN
totalTargetMonth_ * ratio_
)
)
)
I need to connect another table to this model which is shown below.
The result expected is as follows
Achievement column values are getting from Deposits table "Value" columns. Calculation here should be that total value against the month of date shown in first column(if it less than month end total up to that date within the month) and It should be subtracted by the previous month's total value.
Thank for your help.
Downlod:
@sekinod , Not very clear. But you can use time intelligence and date table to get this month vs lasy month values and use those
example
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
this month =MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH('Date'[Date])))
last MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
previous month value = CALCULATE(sum('Table'[total hours value]),previousmonth('Date'[Date]))
diff = [MTD Sales]-[last MTD Sales]
diff % = divide([MTD Sales]-[last MTD Sales],[last MTD Sales])
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
9 | |
7 | |
6 | |
6 |
User | Count |
---|---|
29 | |
11 | |
11 | |
10 | |
6 |