Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi,
I have a measure (data model: https://community.powerbi.com/t5/Desktop/Semi-Additive-Calculations-Total-Values-wrong/m-p/1824181#M...)
Solved! Go to Solution.
Hi, @Bruin87
According to your description and DAX formula, it seems that the problem exists in the TREATAS() function you used because in this condition, your column FactBankBalances[IBAN] is always filtered by the selected value of ‘Date’[Date].
Therefore, I think you can try to find a way to avoid using the TREATAS() function and use other functions to replace it.
You can try to transform the DAX formulas I circled with the DAX below:
VAR BalanceClosing =
CALCULATE (
SUM ( FactBankBalances[Kontostand_Euro] ),
FILTER (
ALLSELECTED ( FactBankBalances ),
[IBAN] IN SELECTCOLUMNS ( MaxDates, "1", [@MaxDate] )
)
)
More info about the TREATAS() function
If you still have a problem, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Bruin87
According to your description and DAX formula, it seems that the problem exists in the TREATAS() function you used because in this condition, your column FactBankBalances[IBAN] is always filtered by the selected value of ‘Date’[Date].
Therefore, I think you can try to find a way to avoid using the TREATAS() function and use other functions to replace it.
You can try to transform the DAX formulas I circled with the DAX below:
VAR BalanceClosing =
CALCULATE (
SUM ( FactBankBalances[Kontostand_Euro] ),
FILTER (
ALLSELECTED ( FactBankBalances ),
[IBAN] IN SELECTCOLUMNS ( MaxDates, "1", [@MaxDate] )
)
)
More info about the TREATAS() function
If you still have a problem, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-robertq-msft ,
thank you for your solution!
I tried to implement it, however, i receive an error message :
Error Message:
MdxScript(Model) (36, 35) Calculation error in measure 'DAX Measures'[Balance Closing]: Function 'CONTAINSROW' does not support comparing values of type Date with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.
Is it comparing the account name (IBAN) with the date?
best regards
marc
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 40 | |
| 37 | |
| 32 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 66 | |
| 58 | |
| 31 | |
| 25 | |
| 24 |