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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
CleliaComes
Helper I
Helper I

Need help with formula DAX for calculating financial ratio

Hi guys

 

I am trying to calculate financial ratio’s Year of Year with a slicer.

In my database I have the financial data for the year 2020 + January 2021.

 

For example I calculated the ratio "solvability : equity / total liabilities".  

 

Equity:
Eigen vermogen = -(CALCULATE('Measures JR'[SOM BS],Rubrieken[Rubriek]="Eigen vermogen")+[SOM PL])

 

Total liabilities:
Totaal vermogen = [Eigen vermogen]+[vreemd vermogen]
Loan capital:  vreemd vermogen: = -(CALCULATE('Measures JR'[SOM BS],Rubrieken[Rubriek]="Vreemd vermogen KT") + CALCULATE('Measures JR'[SOM BS],Rubrieken[Rubriek]="Vreemd vermogen LT"))

 

Solvability:
Solvabiliteit = [Eigen vermogen]/[Totaal vermogen]

 

When I use my date filter ‘Year’ I receive for 2021 the mutations for that year and not the cumulated figure 2020 (openings balance) + 2021 as expected in a balance ratio.

I can select more cases in the filter but I was wondering If there is a formular to solve this problem?

 

 

ratio 2020ratio 2020Ratio 2.png

Kind regards,

Clélia

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@CleliaComes , Formula which you need for last year is not clear , But you can Time intelligence with Date table to get measures for this year and last year example

 

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))

 

This can be done with separate year table with data at year level

 

This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))

 

 

You can create measures for this year and last year and use those

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

 

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.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
CleliaComes
Helper I
Helper I

Thanks a lot for your answer. With the integration of the time intelligence functions the problem was solved and I have nog the cumulated figure. 
Kr

Clélia

amitchandak
Super User
Super User

@CleliaComes , Formula which you need for last year is not clear , But you can Time intelligence with Date table to get measures for this year and last year example

 

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))

 

This can be done with separate year table with data at year level

 

This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))

 

 

You can create measures for this year and last year and use those

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

 

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.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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