cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NandiniC
Microsoft
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
V-lianl-msft
Community Support
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 )
    )
)

View solution in original post

1 REPLY 1
V-lianl-msft
Community Support
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 )
    )
)

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors