Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreShape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.
Hello!
So, I'm trying to resolve this, I believe the answer is righ there in front of me, but I just can't assemble my thoughts right... I have the table below and I need 2 measures: 1) Quantity of distinct projects by department and 2) For each Project and department, how many tasks is a owner responsible by?
I tried to use "group by", but I did it in two steps: firts, I created a new calculated table, grouping by Project, Task, Department and Owner. Then, I created a measure using "group by" like this: COUNTROWS(GROUPBY("groupstep1","groupstep1[Owner]","groupstep1[Task]","groupstep1[Project]". It actually worked, but I was wondering if there is any way to do this without the firts step. Or any better way....
Solved! Go to Solution.
Hi,@ninapetr
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2.Secondly to fulfill your two needs I have created two separate measure and my dax function is as follows:
The first measure is grouped by different sectors, and then the number of different items is counted.
Measure1 = CALCULATE(DISTINCTCOUNT('group'[Project]),FILTER(ALL('group'),'group'[Department]=MAX('group'[Department])))
The second measure filters out different projects, different departments and different owners and then counts the number of tasks.
Measure 2 = CALCULATE(COUNTROWS('group'),FILTER(ALL('group'),'group'[Department]=MAX('group'[Department])&&'group'[Project]=MAX('group'[Project])&&'group'[Owner]=MAX('group'[Owner])))
3.Here's my final result, which I hope meets your requirements.
Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,@ninapetr
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2.Secondly to fulfill your two needs I have created two separate measure and my dax function is as follows:
The first measure is grouped by different sectors, and then the number of different items is counted.
Measure1 = CALCULATE(DISTINCTCOUNT('group'[Project]),FILTER(ALL('group'),'group'[Department]=MAX('group'[Department])))
The second measure filters out different projects, different departments and different owners and then counts the number of tasks.
Measure 2 = CALCULATE(COUNTROWS('group'),FILTER(ALL('group'),'group'[Department]=MAX('group'[Department])&&'group'[Project]=MAX('group'[Project])&&'group'[Owner]=MAX('group'[Owner])))
3.Here's my final result, which I hope meets your requirements.
Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
25 | |
21 | |
20 | |
13 | |
13 |
User | Count |
---|---|
40 | |
28 | |
27 | |
23 | |
21 |