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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors