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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
RPATER
Frequent Visitor

CALCULATE(DISTINCTCOUNT( when using a created if measure

Hi All,

 

I am currently trying to create a card that counts the distinct number of campaigns after two filters are applied to a large table.  The first filter is that column(wave) = 1 and the second is that a measure I created:

"Risk"

IF ( SELECTEDVALUE ( Query1[Wave] ) = 1 && [Delivery_Rate] < .85, 1, 0 )

 

Needs to equal 1.  The final result should be a count of 2 but I either get 19(total number of unique campaigns in the table) or the following error:

"A Function 'Calculate' has been used in a True/False expression that is used as a table filter expression. This is not allowed."

 

I understand that the error is coming from the "Risk" measure but I am not sure of a way around that to get my solution.  Any suggestions would help greatly!

 

Thank You,

Ryan

 

DAX attempts:

1. distinct campaigns = CALCULATE(DISTINCTCOUNT(Query1[CampaignName]),[Risk2]=1, Query1[Wave]=1)
 
2. distinct campaigns = CALCULATE(DISTINCTCOUNT(Query1[CampaignName]),
FILTER(query1,Query1[Wave]=1 && [Delivery_Rate]<.85))
 

Example data:

ClientIdCampaignNameAssetNameRisk
1Campaign1Asset11
2Campaign2Asset21
3Campaign3Asset30
4Campaign4Asset40
1Campaign5Asset50
1Campaign6Asset60
1Campaign7Asset70
1Campaign8Asset80
2Campaign9Asset90
2Campaign10Asset100
2Campaign11Asset110
2Campaign12Asset120
2Campaign13Asset130
2Campaign14Asset140
5Campaign15Asset150
5Campaign16Asset160
5Campaign17Asset170
5Campaign18Asset180
6Campaign19Asset190
1 REPLY 1
lbendlin
Super User
Super User

PLease add the wave column to your sample data.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.