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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
HKBros
New Member

How to get Balance sheet comparative number at year end instead of actual month end

By adding "-1" in below DAX formula, I get Last year comparative number for PL and BS. For PL, that is correct but for balance sheet I want year end number.

 

For example,

In slicers I select "start month 1 end month 4 start year 2023 end year 2023",

the results I get in matrix for comparative numbers PL YTD April 2022, Balance sheet 30th April 2022

Require to update DAX formula to get balance sheet 31st Dec 2022 instead of 30th april 2022. 

 

Below is DAX formula used:

LY Amount in AED = var figure = [AEDin] var startYR=[Start Year]-1 var endYr=[End Year]-1 var startMT=[Start Month] var endMt=[End Month] var PLBS= [BS/PL] return if(PLBS="PL", CALCULATE(SUM('Combined Cubes'[Value]),'Date Master'[Date]>=date(startYR,startMT,1),'Date Master'[Date]<=EOMONTH(date(endYr,endMt,1),0)), CALCULATE(SUM('Combined Cubes'[Value]),'Date Master'[Date]>=date(2022,1,1),'Date Master'[Date]<=EOMONTH(date(endYr,endMt,1),0)))/figure
1 REPLY 1
some_bih
Community Champion
Community Champion

Hi @HKBros as you want to "deal" with dates, one of possible solution is to:

- create Calendar / Date ta ble, check link below.

- after that create measure for year end 2022

Measure test for Balance sheet 2022=
CALCULATE(
SUM('Combined Cubes'[Value]),
PLBS="PL", --change to your table / column accordingly
CALCULATETABLE (
ENDOFYEAR ( 'Date'[Date] ),--Date should be your Calendar / Date table with [Date] column, otherwise change accordingly
'Date'[Date] = DATE ( 2022, 3, 10 ) -- change year
)
)

 

Create Calendar Table Microsoft Learn

https://learn.microsoft.com/en-us/power-bi/guidance/model-date-tables





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors