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
Bruin87
Frequent Visitor

Semi-Additive Calculations - Total Values wrong

Hi, 

here is what i am trying to accomplish:

Target:

Building a Liquidity Report, showing for each business area / company / account the values: Closing Balance, Overdraft, Liquidity, week-over-week change in one single reporting currency

 

Obstacle:

Balances of accounts are reported for different dates.

Missing exchange rates for reported dates

 

Solution approach:

For the exchange rates i used the conversion with a calculated column, finding the last available exchange rate, which seems to work fine

For the account balances i tried to use the DAX Pattern - Semi-additive calculations:

+ Finding last available value for each account

+ Finding opening & closing balance

+ Finding Change between two calendar weeks

 

Problem:

Finding those values for the above mentioned columns worked well, however, on the total level there are values i cannot explain. 

 

Measures:

For example i calculated the overdraft by this measure (the others follow the same logic):

 

Overdraft Latest =
VAR MaxDate = MAX('Date'[Date])

 

VAR MaxDates = CALCULATETABLE(
                               ADDCOLUMNS(
                               SUMMARIZE(FactBankBalances, FactBankBalances[IBAN]),
                              "@MaxDate", CALCULATE(MAX(FactBankBalances[DateKey]))
                              ),
                              'Date'[Date] <= MaxDate
)
VAR MaxDatesWithLineage =
                           TREATAS(MaxDates, FactBankBalances[IBAN], 'Date'[Date])

 

VAR Overdraft = CALCULATE(AVERAGE(FactBankBalances[KK_Linie_Euro]), MaxDatesWithLineage)

 

VAR Result = CALCULATE(
                                           DIVIDE(Overdraft,
                                           SELECTEDVALUE(ReportNumberFormat[SelectedDivision]),
                                           1)
                                            )

Return
      Result

 

The Data Model:

Bruin87_0-1619771035161.png

 

The matrix report:

Bruin87_1-1619771267586.png

With the wrong calculations at the total level.

 

Thankful for any clue 😉

 

Bruin87

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Bruin87 ,

 

Based on your description, maybe you could use ISINSCOPE() or HASONEVALUE() function to define your value of subtotals manually in the matrix visual.

Please refer to the following tutorials.

ISINSCOPE function (DAX) - DAX | Microsoft Docs

HASONEVALUE function (DAX) - DAX | Microsoft Docs

Customizing Hierarchy Measures in DAX using InScope - Visual BI Solutions

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Bruin87 ,

 

Based on your description, maybe you could use ISINSCOPE() or HASONEVALUE() function to define your value of subtotals manually in the matrix visual.

Please refer to the following tutorials.

ISINSCOPE function (DAX) - DAX | Microsoft Docs

HASONEVALUE function (DAX) - DAX | Microsoft Docs

Customizing Hierarchy Measures in DAX using InScope - Visual BI Solutions

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Bruin87 , based on you columns in rows of matrix try new measure like

 

sumx(summarize(Table, Table[Column1], Table[Column2], Table[Column2], "_1", [KK]),[_1])

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.