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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
NandiniC
Employee
Employee

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 )
    )
)

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors