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
Murphs02
Frequent Visitor

Sumif for journal entry table

Hi 

I am new to Power BI so bear with me!

I am building. a report with sap data where I have multiple lines for journal numbers. I need to keep each line as I report on some information on line item level.

So I have a column in my data table with journalid #s

Each journal has several lines, a minimum of two but can be any number. Each line will have an amount totalling to zero for the entire journal (debits and credits).

I need to get the #of journals under a certain value. It's no problem to calculate the value of the total journal (abs value of all lines/2), but I am struggling to get the #s journals under x value.

I can do with a sumif and filter on excel but on power BI it's picking up small values on indiv lines rather than total of abs value /2.

I have tried with sum and filter in DAX without success. 
hoping someone on here can help as I am sure am missing something simple

thanks!

 

1 ACCEPTED SOLUTION
Murphs02
Frequent Visitor

Hi , I got there eventually :-)with sum and Allexcept for the sumif filters.

 

JOURNAL ENTRY TOTAL VALUE = CALCULATE(SUM('ACDOCA EXTRACT JE'[Amount in Global Currency - ABS /2]),ALLEXCEPT('ACDOCA EXTRACT JE','ACDOCA EXTRACT JE'[Journal Entry],'ACDOCA EXTRACT JE'[Fiscal Year],'ACDOCA EXTRACT JE'[Company Code]))

View solution in original post

3 REPLIES 3
Murphs02
Frequent Visitor

Hi , I got there eventually :-)with sum and Allexcept for the sumif filters.

 

JOURNAL ENTRY TOTAL VALUE = CALCULATE(SUM('ACDOCA EXTRACT JE'[Amount in Global Currency - ABS /2]),ALLEXCEPT('ACDOCA EXTRACT JE','ACDOCA EXTRACT JE'[Journal Entry],'ACDOCA EXTRACT JE'[Fiscal Year],'ACDOCA EXTRACT JE'[Company Code]))
Murphs02
Frequent Visitor

VALUE=IFS(SUMIF(E:E,E3,J:J)<1000,"UNDER 1K",SUMIF(E:E,E3,J:J)<5000,"UNDER 5K",SUMIF(E:E,E3,J:J)>5000,"NA")

Pivot with distinct count

Row LabelsDistinct Count of Document NumberGrand Total234

NA88
UNDER 1K70
UNDER 5K76

sample data

Posting DateEntry DateTime of EntryCompany CodeDocument NumberDocument typeG/L AccountCompany Code Currency KeyCompany Code Currency ValueABS/2VALUEDocument Date
31/05/202307/06/202311:35:37US11100221993XX123510USD0.000.00UNDER 1K31/05/2023
31/05/202307/06/202314:27:16US11100222133XX410909USD0.000.00UNDER 1K31/05/2023
31/05/202307/06/202320:33:06US11100222394XX123010USD-2,948,682.831,474,341.42NA31/05/2023
31/05/202307/06/202315:56:11US11100222229XX131500USD-74,524.1037,262.05NA31/05/2023
31/05/202307/06/202315:56:11US11100222229XX131500USD-2,063.421,031.71NA31/05/2023
31/05/202307/06/202321:54:53US11100222425XX560200USD-905,056.00452,528.00NA31/05/2023
31/05/202307/06/202315:56:11US11100222229XX560000USD85,230.8242,615.41NA31/05/2023
31/05/202307/06/202315:56:11US11100222229XX560000USD12,504.516,252.26NA31/05/2023
31/05/202307/06/202315:56:11US11100222229XX131500USD-8,969.844,484.92NA31/05/2023
31/05/202307/06/202315:56:11US11100222229XX131500USD-38,842.1619,421.08NA31/05/2023
31/05/202307/06/202311:35:37US11100221993XX231510USD0.000.00UNDER 1K31/05/2023
31/05/202307/06/202315:56:11US11100222229XX560000USD588.52294.26NA31/05/2023
31/05/202307/06/202321:54:53US11100222425XX134600USD905,056.00452,528.00NA31/05/2023
31/05/202307/06/202320:33:06US11100222394XX123010USD2,944,306.851,472,153.43NA31/05/2023
31/05/202307/06/202315:56:11US11100222229XX560000USD37,076.6118,538.31NA31/05/2023
31/05/202307/06/202320:33:06US11100222394XX560200USD12,531,076.296,265,538.15NA31/05/2023
31/05/202307/06/202320:33:06US11100222394XX560200USD-2,944,306.851,472,153.43NA31/05/2023
31/05/202307/06/202315:56:11US11100222229XX131500USD-1,129.29564.65NA31/05/2023
31/05/202307/06/202315:56:11US11100222229XX560000USD8,969.844,484.92NA31/05/2023
31/05/202307/06/202315:56:11US11100222229XX131500USD-37,076.6118,538.31NA31/05/2023
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the MS Excel file with your formulas/filters/Pivot/Comments Tables so that the logic can beunderstood and translated in the DAX formula language.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.