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
PBrainNWH
Helper II
Helper II

Calculation help (if two columns are not 0 then count)

I'm trying to get a count of records where both FY23 Donations and FY24 Donation <>0, but my calc keeps returning (blank).

CALC:

rReturned in FY2024 =
CALCULATE(
    DISTINCTCOUNT('Opportunity Contact Role'[ContactId]),
    'Opportunity Contact Role'[FY23 Donations] <> 0,
    'Opportunity Contact Role'[FY24 Donations] <> 0
)
 
Both FY23 Donations and FY24 Donations are custom columns:

if [Close_Date__c] > #date(2022, 6, 30) and [Close_Date__c] < #date(2023, 7, 1) then [Amount__c] else 0
 
This is what the data looks like in a table:

PBrainNWH_0-1722112528916.png

And maybe there's a better way to count ids of donors that donated in both fy23 and fy24? I'm stumped.

 

Thanks.

 
 
1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi @PBrainNWH ,

 

What about replacing the comma with double ampersand (&&)? 

DataNinja777_0-1722124651885.png

 

 In a copy-pasteable format:

rReturned in FY2024 =
CALCULATE (
    DISTINCTCOUNT ( 'Opportunity Contact Role'[ContactId] ),
    'Opportunity Contact Role'[FY23 Donations] <> 0
        && 'Opportunity Contact Role'[FY24 Donations] <> 0
)

Best regards,

View solution in original post

2 REPLIES 2
PBrainNWH
Helper II
Helper II

Thanks! I actually was able to create this:

FY24 Status =
IF(
'Donations by Customer by FY'[2023 Donations] <> 0 && 'Donations by Customer by FY'[2024 Donations] <> 0,
"Retained",
IF(
'Donations by Customer by FY'[2023 Donations] = 0 && 'Donations by Customer by FY'[2024 Donations] <> 0,
"New424",
"Lapsed"
)
)

I can now count the statuses.

DataNinja777
Super User
Super User

Hi @PBrainNWH ,

 

What about replacing the comma with double ampersand (&&)? 

DataNinja777_0-1722124651885.png

 

 In a copy-pasteable format:

rReturned in FY2024 =
CALCULATE (
    DISTINCTCOUNT ( 'Opportunity Contact Role'[ContactId] ),
    'Opportunity Contact Role'[FY23 Donations] <> 0
        && 'Opportunity Contact Role'[FY24 Donations] <> 0
)

Best regards,

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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