Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
I am trying to sum all the data in a column of a table where that column name is based on the row name of the table I am in, I am unable to find anything around this and was wondering if anyone had any good examples.
For context the columns are a list of names and I am trying to get a total of their "points" across a list of events.
Thanks in advance!
Solved! Go to Solution.
This example can help you.
Events table:
Event Alice Bob Charlie
Event1 10 5 8
Event2 7 3 6
Event3 4 8 9
_________________________
Participants table:
Name
Alice
Bob
Charlie
_______________________
Create a measure to sum the points for each participant across all events:
TotalPoints =
VAR ParticipantName = SELECTEDVALUE(Participants[Name])
RETURN
SUMX(
Events,
SWITCH(
ParticipantName,
"Alice", Events[Alice],
"Bob", Events[Bob],
"Charlie", Events[Charlie],
0
)
)
This example can help you.
Events table:
Event Alice Bob Charlie
Event1 10 5 8
Event2 7 3 6
Event3 4 8 9
_________________________
Participants table:
Name
Alice
Bob
Charlie
_______________________
Create a measure to sum the points for each participant across all events:
TotalPoints =
VAR ParticipantName = SELECTEDVALUE(Participants[Name])
RETURN
SUMX(
Events,
SWITCH(
ParticipantName,
"Alice", Events[Alice],
"Bob", Events[Bob],
"Charlie", Events[Charlie],
0
)
)
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
7 | |
6 |