Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

countif displaying frequency

Forum home » Delegate support and help forum » Microsoft Power BI training and help » Countif & Displaying Frequency

Countif & Displaying Frequency

ResolvedVersion 2016

Countif & Displaying Frequency

Hi!

I am trying to show the frequency of contact to our constituents. I would usually do this by using countif in excel, pasting back the values, de-duping and then creating a chart based on the countif column that would count the number of constituents. so a table would have headings of "# times contacted" and "count" and values would show that 250 people have been contacted twice, 400 people have been contacted 3 times and so on.

I don't seem to be able to do this in BI!

Any help welcome!

Thanks,
Lou

RE: Countif & Displaying Frequency

Hi Lou,

Thank you for the forum question.

Countif and Sumif are not straight forward in DAX. To create a Countif column you will need a very special DAX function called Earlier. It will test all the rest of the rows up against the row it is in.

If you have a look at the link below, you will find the solution you need.



https://www.goodly.co.in/countif-power-bi-dax/


Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: Countif & Displaying Frequency

Hi Jens,

Thank you for sending this.
Is there a reason that whenever I try to use EARLIER it doesn't recognise any table names or columns or any reference after it? They are all greyed out.

Thanks,

RE: Countif & Displaying Frequency

Hi Lou,

Earlier test each row in the in the table you have the column calculation in (In the column you use Earlier to CountIf). It will not understand related tables.

I need to have a better understanding of your data model. If you want to "Countif" something, where the criteria is in another table the method will be different.

Can I please ask you to take a screenshot of your data model and explain, in which column you want to count something and where you get the criteria from.

You can send it to: info@stl-training.co.uk


Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

 

Training courses

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Power BI tip:

Master DAX (Data Analysis Expressions)

DAX is the formula language used in Power BI for creating custom calculations and aggregations. Invest time in learning DAX to unlock the full potential of Power BI. Understand functions like CALCULATE, FILTER, and SUMX, as they are fundamental for creating complex calculations and measures.

View all Power BI hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.