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
MonyridhYady
Frequent Visitor

Countifs + Filter in Dax

Hi all I'm fairly new to PBI and is looking for a way I could replicate a countifs function on dax. I have examples in the screenshots below of what I want to replicate on excel

 

Context for Excel screenshot below, I have 10 companies but 2 of them are duplicates (Company C and D) because they subscribed to a different Plan. Hence, I am counting 12 which is what I want. The bar chart is also something I want in PBI as well.

MonyridhYady_1-1666865247063.png

 

Context for the excel screenshot below: This is the data that I currently have. There are over thousands of row for each month where companies renew their plans (We can existing) and other companies start their plans with us (New)

MonyridhYady_2-1666865640864.png

 

So to reiterate my question: I would like to only filter out existing companies plans with us and only countifs new companies subscriptions. So that if a company has one subscription with us we will count that as 1 new connection, if a company has 3 plans with us we will count that as 3 new connections

 

Cheers, I hope I've made my question clear since it was quite confusing for me to write this

 

 

1 ACCEPTED SOLUTION

Thanks for the help, but I think I solved it using this after watching a few videos.

 

CountNew =
SUMX(SUMMARIZE(Data,'Date'[Month Year],Data[company_name],Data[Plan_edit],"Total_count",1),[Total_count])

View solution in original post

2 REPLIES 2
v-yueyunzh-msft
Community Support
Community Support

Hi , @MonyridhYady 

(1)For your first need , you just need to put the filed on the visual , like this :

vyueyunzhmsft_0-1666922331094.png

And my test data is as follows:

vyueyunzhmsft_1-1666922346083.png

 

(2)For you second need ,This is my test data:

vyueyunzhmsft_2-1666922546321.png

We need to click "New measure "to create a measure :

Measure = var _t = FILTER('Table2','Table2'[stausplan_name] ="EXISTING")
return
COUNTROWS(_t)

Then we put the filed in the visual and we will meet your need :

vyueyunzhmsft_3-1666922594834.png

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

 

Best Regards,

Aniya Zhang

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

Thanks for the help, but I think I solved it using this after watching a few videos.

 

CountNew =
SUMX(SUMMARIZE(Data,'Date'[Month Year],Data[company_name],Data[Plan_edit],"Total_count",1),[Total_count])

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.