The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I have a simple calculation "Bad Marks":
IF(SUM([table].Value1) < SUM([table].Value2,1,0)
I also have a non balanced (ragged) parent child hierarchy:
ParentId | OrgId | OrgName |
1 | 1 | Company |
1 | 2 | Region 1 |
1 | 3 | Region 2 |
1 | 4 | Region 3 |
2 | 5 | Office 1 |
2 | 6 | Office 2 |
3 | 7 | Office 3 |
3 | 8 | Office 4 |
4 | 9 | Subregion 1 |
4 | 10 | Subregion 2 |
9 | 11 | Office 5 |
9 | 12 | Office 6 |
10 | 13 | Office 7 |
10 | 14 | Office 9 |
How do I calculate the number of lowest level children with "bad marks" for each node?
Something like
OrgName | No of bad marks |
Company | 6 |
Region 1 | 1 |
Region 2 | 4 |
Region 3 | 1 |
Subregion 1 | 1 |
Subregion 2 | 0 |
Regards John
Hello Greg,
Are you looking for this:
OrgStructure Table
ParentId OrgId OrgName
1 1 Company
1 2 Region 1
1 3 Region 2
1 4 Region 3
2 5 Office 1
2 6 Office 2
3 7 Office 3
3 8 Office 4
4 9 Subregion 1
4 10 Subregion 2
9 11 Office 5
9 12 Office 6
10 13 Office 7
10 14 Office 9
Values Table
OrgId Value1 Value2
5 1 2
6 2 1
7 3 4
8 4 5
11 4 6
12 7 8
13 19 12
14 4 10
Expected Output
Company , 3
Region 1,1
Office 1,0
Office 2,1
Region 2,0
Office 3,0
Office 4,0
Region 3, 1
Subregion 1 ,0
Office 5, 0
Office 6, 0
Subregion 2, 1
Office 7 , 0
Office 9 , 1
Regards John
@PH9Z I feel like I am missing some source data to be able to create the calculation. Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
21 | |
12 | |
10 | |
7 |