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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.