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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JKHATRAK
Frequent Visitor

Calculate, Sum, Filters - Dax Query

Hi, How do i correct below formula in Power Bi. Criteria is: I need Sum of (USD) where we have not contacted customer for more than 15 days with specific excuse code description as mentioned in below formula with specific Ageing Bucket.
I am getting below error. Please let me know what changes should be done to correct the formula.
 
Error: True/False expression does not specific a column. Each True/False expressions used as a table filter expression must refer to exactly one column.
 
Last Engagement Made Greater than 15 days = CALCULATE(SUM('Raw Data'[USD]),'Raw Data'[Days since last engagement] = "Greater than 15days",'Raw Data'[Excuse Code Description] = "Business Interruption","Contact Made","Credit Balance Known to customer","0.Default","9.Govmt/Institution Slow Pay/Funding","7.Payment Awaiting Approval","11.Pending Support from Business","4.Customer Researching","5.Credit Balance,In Research","6.Unresponsive Customer","1.Initial Contact pre due date",'Raw Data'[Pocket] = "1-30","31-60","61-90","91-120","Over 120")
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @JKHATRAK ,

Please update the formula of the measure [Last Engagement Made Greater than 15 days] as below and check if it works or not... 

Last Engagement Made Greater than 15 days =
CALCULATE (
    SUM ( 'Raw Data'[USD] ),
    FILTER (
        'Raw Data',
        'Raw Data'[Days since last engagement] = "Greater than 15days"
            && 'Raw Data'[Excuse Code Description]
            IN {
            "Business Interruption",
            "Contact Made",
            "Credit Balance Known to customer",
            "0.Default",
            "9.Govmt/Institution Slow Pay/Funding",
            "7.Payment Awaiting Approval",
            "11.Pending Support from Business",
            "4.Customer Researching",
            "5.Credit Balance,In Research",
            "6.Unresponsive Customer",
            "1.Initial Contact pre due date"
        }
            && 'Raw Data'[Pocket] IN { "1-30", "31-60", "61-90", "91-120", "Over 120" }
    )
)

And you can use DAX Formatter to format your formula and check there is no syntax error...

yingyinr_0-1665651945727.png

 

If the above one can't help you get the desired result, please provide some sample data in your table 'Raw data' (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @JKHATRAK ,

Please update the formula of the measure [Last Engagement Made Greater than 15 days] as below and check if it works or not... 

Last Engagement Made Greater than 15 days =
CALCULATE (
    SUM ( 'Raw Data'[USD] ),
    FILTER (
        'Raw Data',
        'Raw Data'[Days since last engagement] = "Greater than 15days"
            && 'Raw Data'[Excuse Code Description]
            IN {
            "Business Interruption",
            "Contact Made",
            "Credit Balance Known to customer",
            "0.Default",
            "9.Govmt/Institution Slow Pay/Funding",
            "7.Payment Awaiting Approval",
            "11.Pending Support from Business",
            "4.Customer Researching",
            "5.Credit Balance,In Research",
            "6.Unresponsive Customer",
            "1.Initial Contact pre due date"
        }
            && 'Raw Data'[Pocket] IN { "1-30", "31-60", "61-90", "91-120", "Over 120" }
    )
)

And you can use DAX Formatter to format your formula and check there is no syntax error...

yingyinr_0-1665651945727.png

 

If the above one can't help you get the desired result, please provide some sample data in your table 'Raw data' (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Thank you Very Much. This works 🙂

Greg_Deckler
Community Champion
Community Champion

@JKHATRAK Hard to tell exactly but that is definitely incorrect syntax. Try one of these:

Last Engagement Made Greater than 15 days = 
	CALCULATE(
		SUM('Raw Data'[USD]),
		'Raw Data'[Days since last engagement] = "Greater than 15days",
		'Raw Data'[Excuse Code Description] IN { "Business Interruption","Contact Made","Credit Balance Known to customer","0.Default","9.Govmt/Institution Slow Pay/Funding","7.Payment Awaiting Approval","11.Pending Support from Business","4.Customer Researching","5.Credit Balance,In Research","6.Unresponsive Customer","1.Initial Contact pre due date" },
		'Raw Data'[Pocket] = "1-30","31-60","61-90","91-120","Over 120"
	)


Last Engagement Made Greater than 15 days = 
  VAR __Table =
	FILTER('Raw Data',
		'Raw Data'[Days since last engagement] = "Greater than 15days",
		'Raw Data'[Excuse Code Description] IN { "Business Interruption","Contact Made","Credit Balance Known to customer","0.Default","9.Govmt/Institution Slow Pay/Funding","7.Payment Awaiting Approval","11.Pending Support from Business","4.Customer Researching","5.Credit Balance,In Research","6.Unresponsive Customer","1.Initial Contact pre due date" },
		'Raw Data'[Pocket] = "1-30","31-60","61-90","91-120","Over 120"
	)
RETURN
  SUMX(__Table, [USD])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.