Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have two tables.
For each unique combination of Employee and Location I want to count number of existing documents and create a new column in second table with the count only.
The result should be following:
In the report view, when I have a table with the final table, I also want to be able to filter out the dates based on the first table. So for example If I filter year 2000, for Jan & Poland I want to see Count of Documents = 1.
Can anyone help me with this?
Solved! Go to Solution.
If you want it to react to slicers and filters then you need to do it as a measure not as a calculated column.
First create a couple of dimension tables which you can link to your documents table and then create a measure
// New Table
Employee = DISTINCT('Documents'[Employee])
// New Table
Location = DISTINCT('Documents'[Location])
// Measure
Num documents = COUNTROWS('Documents')
Put the columns from your new tables into a visual with the measure.
If you want it to react to slicers and filters then you need to do it as a measure not as a calculated column.
First create a couple of dimension tables which you can link to your documents table and then create a measure
// New Table
Employee = DISTINCT('Documents'[Employee])
// New Table
Location = DISTINCT('Documents'[Location])
// Measure
Num documents = COUNTROWS('Documents')
Put the columns from your new tables into a visual with the measure.
Thank you! It works properly, but in some cases there are no documents for an employee, who is present only in the second table, and I also want to display this on my visual. What should I do in order to be able to see this information?
You could change the measure to be
Num documents = COALESCE( COUNTROWS('Documents'), 0)
Thank you a lot! It works perfectly
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
8 | |
6 |