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
UK_User123456
Resolver I
Resolver I

Counting the number of Campaign ID's

Hi All,

 

Below is an example of the dataset to which I wanted to be able to return the total number of campaign ID's given in the first instance, then counting the number of campaign ID's that were given in the second instance .

 

Gift DateCampaign IDGift Date 2Campaign ID 2
02/04/2018Camp - 12115/05/2018Camp - 252
12/05/2019Camp - 23216/05/2019Camp - 252
06/05/2019Camp - 12123/05/2019Camp - 252
07/06/2019Camp - 23201/06/2019Camp - 252
08/05/2019Camp - 12112/05/2019Camp - 555
09/06/2018Camp - 12123/06/2018Camp - 252
10/06/2019Camp - 12112/06/2019Camp - 252
11/06/2018Camp - 23215/06/2018Camp - 232
12/06/2019Camp - 12115/06/2018Camp - 232
13/06/2018Camp - 12117/06/2018Camp - 232
Total10  
    
 2526 
 5551 
 2323 

 

I tried doing a count, but keep getting errors. didnt know if there was an alternative way of doing this?

 

TIA

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @UK_User123456 ,

The following is my sample you can have a try.

 

For table 1 :

  1. Create a measure.
Measure = COUNT(Table1[Campaign ID])

1.png

For table 2:

  1. Create a measure
Measure 2 = 
SWITCH(     TRUE(),     MAX(Table4[Campaign ID 2]) = "Camp - 252",CALCULATE(COUNT(Table4[Campaign ID 2]),ALLEXCEPT(Table4,Table4[Campaign ID 2])),     MAX(Table4[Campaign ID 2]) = "Camp - 232",CALCULATE(COUNT(Table4[Campaign ID 2]),ALLEXCEPT(Table4,Table4[Campaign ID 2])), MAX(Table4[Campaign ID 2]) = "Camp - 555",CALCULATE(COUNT(Table4[Campaign ID 2]),ALLEXCEPT(Table4,Table4[Campaign ID 2])))

2.jpg

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
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

4 REPLIES 4
v-xuding-msft
Community Support
Community Support

Hi @UK_User123456 ,

Could you tell me if your problem has been solved? If it is, kindly mark the helpful answer as a solution if you feel that makes sense. Welcome to share your own solution. More people will benefit from here.

 

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

 

I havent had the chance to test it out yet, I will do as soon as I can and come back with any issues.

Okay, I hope your issue can be solved smoothly. 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-xuding-msft
Community Support
Community Support

Hi @UK_User123456 ,

The following is my sample you can have a try.

 

For table 1 :

  1. Create a measure.
Measure = COUNT(Table1[Campaign ID])

1.png

For table 2:

  1. Create a measure
Measure 2 = 
SWITCH(     TRUE(),     MAX(Table4[Campaign ID 2]) = "Camp - 252",CALCULATE(COUNT(Table4[Campaign ID 2]),ALLEXCEPT(Table4,Table4[Campaign ID 2])),     MAX(Table4[Campaign ID 2]) = "Camp - 232",CALCULATE(COUNT(Table4[Campaign ID 2]),ALLEXCEPT(Table4,Table4[Campaign ID 2])), MAX(Table4[Campaign ID 2]) = "Camp - 555",CALCULATE(COUNT(Table4[Campaign ID 2]),ALLEXCEPT(Table4,Table4[Campaign ID 2])))

2.jpg

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.