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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Kudoed Authors