Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I have learned Power BI for few weeks.
I want to make a report in Power BI, which should look something like this 🙂
Let's assume that all data comes from the Person table, and that when counting absent people, we do not distinguish whether it is a student or a teacher.
Person
(
id
, gender in (M, F)
, position in (student, teacher)
, isPresent in (1, 0)
)
Is it possible to do something like this in Power BI?
I mean whether it is possible to present the summarization in multiple rows (like on picture in few rows below TOTAL row)?
And is it possible to make two-line header in the matrix (as in my picture)?
Solved! Go to Solution.
Hi, @michaelC0
Measure =
IF(ISINSCOPE('Table'[Gender ]),SUM('Table'[Qty]),
var _total=SUMX(VALUES('Table'[Career]),SUM('Table'[Qty]))
var _totalall=SUMX(ALL('Table'),'Table'[Qty])
Return
FORMAT(DIVIDE(_total,_totalall),"percent"))
Best Regards,
Link
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @michaelC0
Measure =
IF(ISINSCOPE('Table'[Gender ]),SUM('Table'[Qty]),
var _total=SUMX(VALUES('Table'[Career]),SUM('Table'[Qty]))
var _totalall=SUMX(ALL('Table'),'Table'[Qty])
Return
FORMAT(DIVIDE(_total,_totalall),"percent"))
Best Regards,
Link
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
v-xulin-mstf , thank you. Your answer helped me a lot.
Now I am trying to calculate percentage (not sum) within each group.
Then I could eventually make a report that will consist of two matrixes - first with subtotals for each groups and second with grand total.
Thank you for your response.
Is there a possibility to achieve at least somethink like that:
?
I guess first I need to create some measures:
all_persons = COUNT(Person[id])
It gives 100 (44 + 43 + 5 + 6 + 1+ 1)
students = CALCULATE (DISTINCTCOUNT (Person[IsStudent]), FILTER ( Person[IsStudent]= 1))
It gives 87 (44 + 43)
teachers = CALCULATE (DISTINCTCOUNT (Person[isTeacher]), FILTER ( Person[isTeacher]= 1))
It gives 11 (5 + 6)
But how to create new measure which return proper value (students or teachers) for specific column? I mean 87 for column STUDENT and 11 for column TEACHER.
If I have such measure then I could calculate percentage.
In my previous post I forgot to write that I use matrix with fields group and gender in Rows and isStudent, isTeacher in Values.
Person
(
id
, gender in (M, F)
, group
, isStudent (1, 0)
, isTeacher (1, 0)
, isPresent in (1, 0)
)
@Anonymous , I doubt you can get a display like that easily. Check if there is some custom visual that can help
https://appsource.microsoft.com/en-us/marketplace/apps?product=power-bi-visuals
Another Idea can be that you create few visuals and group them together : https://docs.microsoft.com/en-us/power-bi/desktop-grouping-visuals
@Anonymous To be very honest, it is not going to be easy to get the output the way you described.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
98 | |
81 | |
65 | |
62 |
User | Count |
---|---|
147 | |
116 | |
104 | |
88 | |
65 |