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
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
v-yiruan-msft
Community Support
Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yiruan-msft
Community Support
Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you Very Much. This works 🙂

Greg_Deckler
Super User
Super User

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

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.