cancel
Showing results for
Did you mean:  Microsoft

## DAX expression to calculate sum of Business Central

We are putting together a Power BI solution for our client.DAX expression to calculate sum of Business CentralIt is connected to the client's Dynamics 365 Business Central - Finance.We are able to connect to the Dynamics 365 Business Central data sources and access data from APIs and Web Services.Using G/L entries, we can calculate totals for all Posting accounts.We need to be able to get totals for accounts with 'Account_Type' = Total.These accounts have a 'Totaling' value that can include multiple account number ranges (EG: 59999..62000|62500..66000|67500..69000 etc).Would you please send me a DAX formula that will calculate the summ of such a Total account from the Totaling ranges and the G/L entries? calculate sum of Business Central total account from totaling ranges and G/L entries.

1 ACCEPTED SOLUTION  Community Support

Try using the && and || function:

totals =
CALCULATE (
SUM ( 'TABLE'[account] ),
FILTER (
'TABLE',
( 'TABLE'[account number ] >= 59999
&& 'TABLE'[account number ] <= 62000 )
|| ( 'TABLE'[account number ] >= 62500
&& 'TABLE'[account number ] <= 66000 )
|| ( 'TABLE'[account number ] >= 67500
&& 'TABLE'[account number ] <= 69000 )
)
)  Community Support

Try using the && and || function:

totals =
CALCULATE (
SUM ( 'TABLE'[account] ),
FILTER (
'TABLE',
( 'TABLE'[account number ] >= 59999
&& 'TABLE'[account number ] <= 62000 )
|| ( 'TABLE'[account number ] >= 62500
&& 'TABLE'[account number ] <= 66000 )
|| ( 'TABLE'[account number ] >= 67500
&& 'TABLE'[account number ] <= 69000 )
)
)  