Forum Discussion
Measure as a column for Bar chart Y axis selection
- 1 year ago
HI CornelisV
The problem occurs because there is a many-to-many relationship between
'Group table'and'Score table'.
This creates ambiguity when trying to sum values in a bar chart Y-axis selection, which can lead to incorrect results.Solution:
To resolve this, you should introduce a bridge table that contains unique weeks, ensuring a proper relationship between the tables.
The model should be structured as follows:Then you can use DAX FORMULA
Sum_selected_group = VAR selected_group = SELECTEDVALUE('Group table'[Group]) VAR A = SUM('Score table'[A]) VAR B = SUM('Score table'[B]) RETURN IF (selected_group = 490, A, B)Result :
More information about handalling eith many to many relationships here :
https://www.youtube.com/watch?v=aPLaun-tTgQThe pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
HI CornelisV
The problem occurs because there is a many-to-many relationship between 'Group table' and 'Score table'.
This creates ambiguity when trying to sum values in a bar chart Y-axis selection, which can lead to incorrect results.
Solution:
To resolve this, you should introduce a bridge table that contains unique weeks, ensuring a proper relationship between the tables.
The model should be structured as follows:
Then you can use DAX FORMULA
Sum_selected_group =
VAR selected_group = SELECTEDVALUE('Group table'[Group])
VAR A = SUM('Score table'[A])
VAR B = SUM('Score table'[B])
RETURN
IF (selected_group = 490, A, B)
Result :
More information about handalling eith many to many relationships here :
https://www.youtube.com/watch?v=aPLaun-tTgQ
The pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi Ritaf1983 ,
Thank you for your fast response and solution. You are right, I forgot to add a bridge table with only weeknumbers. The provided DAX solution is exact what I'm looking for, it is clear that DAX knowledge is inevitable to solve your programming issue.
BR,
Cornelis