"in values"
1 TopicProblem with DAX calculating a value using filters from two tables
First of all, greetings. This is my first post. As a new user my knowledge is limited but I will try to grow in this data world. In this example, I am trying to calculate against how many 'top' teams (X) has Y (Segmentation choice of another club) faced. I've worked on this with SQL Server because I'm much more familiar with it. The sentence looks like this: SELECT COUNT(*) FROM dimGames WHERE club_id = 131 AND opponent_id IN (SELECT club_id FROM dimClubs WHERE category = 1) With SQL I had to specify the 'club_id', but I want this to be the filtered field. If I change the 'category' to 2, 3, 4... I get the correct number of games 131 (Fc Barcelona) played against 'category X' clubs. - dimGames has information about specific data of the game, but we only have to know there are 'game_id', 'club_id' and 'opponent_id' columns. Being 'club_id' and 'opponent_id' both related to dimClubs[club_id]. - dimClubs has precise information about a club. In this case, the important columns are 'club_id' and 'category'. The problem is when I change this sentence to DAX, where 'club_id' and 'opponent_id' share the same 'club_id' column in the dimClubs table. The farther I've reached is a sentence like this: Games Vs C1:= CALCULATE( COUNTROWS(dimGames), dimGames[opponent_id] IN VALUES(dimClubs[club_id]), dimClubs[category] = 1) But there's no result (BLANK) in the Visual Card when I select a club from the Segmentation. I've tried to add another filter to the CALCULATE: dimGames[club_id] = SELECTEDVALUE(dimClubs[club_id]) Still getting BLANK. Sincerely I don't know what to try. Any help? Thank you so much.644Views0likes3Comments