Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi everyone,
I have the following formula:
United Measure =
VAR SelectedColumn = SELECTEDVALUE('C'[C])
Return SWITCH(SelectedColumn;
"C1"; SUMX('E&A';'E&A'[Hours]*RELATED('A&C'[C1]));
"C2"; SUMX('E&A';'E&A'[Hours]*RELATED('A&C'[C2]));
"C3"; SUMX('E&A';'E&A'[Hours]*RELATED('A&C'[C3]))
As a quick run down, those are the table I am using:
Table 1: (List of A's)
A's |
A1 |
A2 |
A3 |
... |
A100 |
Table 2. (List of E's)
E's |
E1 |
E2 |
E3 |
... |
E100 |
Table 3. (List of C's)
C's |
C1 |
C2 |
C3 |
... |
C100 |
Table 4. (Relation between A's and each C's)
A's | C1 | C2 | C3 | ... | C100 |
A1 | 1 | 1 | 1 | ... | 0 |
A2 | 0 | 1 | 1 | ... | 1 |
A3 | 1 | 0 | 1 | ... | 1 |
... | ... | ... | ... | ... | ... |
A100 | 1 | 1 | 0 | ... | 1 |
Table 5. (Relation between A's and E's in hours)
E's | A's | Hours |
E1 | A1 | 3 |
E1 | A2 | 2 |
E1 | A3 | 5 |
E2 | A1 | 1 |
E2 | A100 | 7 |
E3 | A1 | 3 |
E3 | A3 | 4 |
E3 | A100 | 2 |
... |
|
|
E100 | A2 | 1 |
End matrix:
E's | C1 | C2 | C3 | ... | C100 |
E1 | 8 |
|
|
|
|
E2 |
|
|
|
|
|
E3 |
|
|
|
|
|
... |
|
|
|
|
|
E100 |
|
|
|
|
|
I hope this is understandable.
Best regards,
@Anonymous can you share sample pbix file with expected output and can look at it. It is bit hard to understand and reproduce the dataset from your post.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
92 | |
75 | |
65 | |
49 | |
36 |
User | Count |
---|---|
114 | |
89 | |
80 | |
60 | |
40 |