Forum Discussion
Countif for row based count (A:A=A2)
Hi Raindeer,
You should make a measure not a calculated column. The use of the measure will allow you to add context to your visuals and change the calculations only by adding or removing columns from your visuals.
Regards,
MFelix
Hi MFelix,
Thank you for your help. I will try measures and see if I can achieve my required objevtive.
- MFelix8 years agoSuper User
Hi Raindeer,
Just to make this clear you just want to count how many times the A repeats in the full table right? You want this on a table visual.
Just add the ABC column on the table twice and change a summarization, if you need to have this calculated for using in a different way should use the measure.
Not really sure if this is what you want but this is a basic feature on PBI.
Or do you need to make any additional calculations or formulas.
Regards,
MFelix
- Raindeer8 years agoFrequent Visitor
Hi,
unfortunately my project is a little complex. The underlying goal is to weigh workload of individuals through counting the number of tasks they had at a given time. Each date and hour entry represent a task. I normally do this through countif in Excel.
In attached picture, lookup is just date and hour with hyphen in middle. Values in column "table 1" is count of occurance lookup values appear in table 1 [=countif(Table1!C:C=C2)]. Same logic is applied on table 2 and 3. Workload is sum of each row.
I need to do exactly this in Power BI for a KPI but it looks like an impossible task :(
- MFelix8 years agoSuper User
Hi Raindeer,
You have to ways of doind this in PBI.
1 - Create a table with the Lookup values column (with unique values) and another one with date then just make a relationship between this two tables and your other 4 tables, thens just add the columns for each of your table and the total row will add up all the values.
2 - Make and append of all the tables in a single table in Query editor, one of the colums should be the table name, then just add the columns on the visual and the table name as column headers.
If you want I can prepare some sample PBIX file for you if you share the information that you have on the previous post has all your tables look like with the full details by line.
Regards,
MFelix