Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
Thank you so much for helping. I'm in a university as an advisory faculty to student issues.
Here's the data I loaded into Power BI:
Table 1
| Name | Issues |
| David | Academic |
| David | Psychosocial |
| David | Financial |
| Betty | Academic |
| Betty | Pyschosocial |
| John | Academic |
| John | Financial |
| Rachel | Psychosocial |
| Rachel | Professional |
| Fred | Academic |
| Cindy | Academic |
| George | Psychosocial |
| Ella | Financial |
| Simon | Professional |
I have no problems doing this:
| Issues | Number of Students |
| Academic | 5 |
| Psychosocial | 4 |
| Financial | 3 |
| Professional | 2 |
What I did was to create a measure: Count = COUNTROWS(Table1)
Then I selected Table in Visualisation, clicked on Issues and the new measure Count (like the graphic below) and it returns the table above:
But what I really want to do is to construct a Table 2 from Table 1 to count how many students have how many issues: like this:
Table 2
| Number of Issues | Number of Students |
| 3 | 1 |
| 2 | 3 |
| 1 | 5 |
What measures or columns in DAX do I create so that I can click them to get the table 2 visualization?
Thank you so much! This is driving me mad!
YS, Ng
Solved! Go to Solution.
Hi, @NYS
You can try the following methods.
Table:
Table2 = SUMMARIZE('Table1','Table1'[Name],"Count Name",CALCULATE(COUNT('Table1'[Name]),ALLEXCEPT('Table1','Table1'[Name])))
Column:
Number of Students = CALCULATE(COUNT(Table2[Count Name]),ALLEXCEPT(Table2,Table2[Count Name]))Number of Issues = CALCULATE(COUNT('Table1'[Issues]),FILTER('Table1',[Name]=EARLIER(Table2[Name])))
Is this the result you expect? Please see the attached document.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @NYS
You can try the following methods.
Table:
Table2 = SUMMARIZE('Table1','Table1'[Name],"Count Name",CALCULATE(COUNT('Table1'[Name]),ALLEXCEPT('Table1','Table1'[Name])))
Column:
Number of Students = CALCULATE(COUNT(Table2[Count Name]),ALLEXCEPT(Table2,Table2[Count Name]))Number of Issues = CALCULATE(COUNT('Table1'[Issues]),FILTER('Table1',[Name]=EARLIER(Table2[Name])))
Is this the result you expect? Please see the attached document.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@NYS
Create a new table to get the sequence to of count of students.
Table2 =
SELECTCOLUMNS(
GENERATESERIES( 1 , DISTINCTCOUNT( Table1[Name] ) ),
"Student Count" , [Value]
)
Create the collowing meaure, using it on a table visual with the previous table column.
Issue Count =
VAR __Std = SELECTEDVALUE( Table2[Student Count] )
RETURN
COUNTROWS(
FILTER(
ADDCOLUMNS(
SUMMARIZE( Table1 , Table1[Name] ),
"Count" , CALCULATE( COUNT( Table1[Issues] ) )
),
[Count] = __Std
)
)
File is attached
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 22 | |
| 10 | |
| 10 | |
| 7 | |
| 5 |