Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
25 | |
20 | |
18 | |
17 | |
17 |
User | Count |
---|---|
34 | |
21 | |
19 | |
18 | |
10 |