Forum Discussion
amitgajkal2007
2 years agoFrequent Visitor
Dax query
I have a table named (data) and two columns team1 and team2 want to undersand 1. count number of maches played by each team and 2. count of wins by each team input data team1 team2 win...
- 2 years ago
Hi amitgajkal2007
The first step is to transform the table to vertical to make the analysis easier.You can do it with the "unpivot" option of PQ
Then you will get the table as in the picture :
From here you can create 2 simple dax measures :
1. For matches :
matches = COUNTROWS('Table')2. For wins:wins = CALCULATE([matches],SELECTEDVALUE('Table'[Team])='Table'[winner])Result :pbix is attached, you can follow my steps at pq and dax.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Ritaf1983
2 years agoSuper User
Hi amitgajkal2007
Happy to help 🙂 Why many to many,
it is just 1 table..
According to DAX, I see that @sanalytics gave a solution.
amitgajkal2007
2 years agoFrequent Visitor
Unpivoting creates a havoc on other reports. the slicers simply stop to work and doesnt filter.
hence i was asking for DAX approach. I have 4 tables, 20+ columns and 20k+ rows.
Thanks