Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
HI team i am very new for Dax will you please help me out here
Thanks in advance
Team 1 Team2
A C
B A
C B
A B
C A
A D
A C
Answer likw A = 6
B = 3
C = 3
D = 1
Solved! Go to Solution.
@Girish_123 you can use a measure like this
Measure =
VAR _0 =
UNION (
SELECTCOLUMNS ( 'Table', "c1", 'Table'[column1] ),
SELECTCOLUMNS ( 'Table', "c1", 'Table'[column2] )
)
RETURN
MAXX (
ADDCOLUMNS (
'Table 2',
"freq",
MAXX (
FILTER (
ADDCOLUMNS (
_0,
"Frequency", COUNTX ( FILTER ( _0, EARLIER ( [c1] ) = [c1] ), [c1] )
),
[c1] = EARLIER ( 'Table 2'[column1] )
),
[Frequency]
)
),
[freq]
)
Define a new table Teams as follows:
Teams =
DISTINCT ( UNION ( VALUES ( Table1[Team 1] ), VALUES ( Table1[Team 2] ) ) )
Then set up relationships with both Team 1 and Team 2 columns in the model:
You can count both columns like this:
Count =
CALCULATE (
COUNT ( Table1[Team 1] ),
USERELATIONSHIP ( Teams[Team], Table1[Team 1] )
)
+ CALCULATE (
COUNT ( Table1[Team 2] ),
USERELATIONSHIP ( Teams[Team], Table1[Team 2] )
)
You can do it without setting up the relationships too:
Count =
CALCULATE (
COUNT ( Table1[Team 1] ),
Table1[Team 1] IN VALUES ( Teams[Team] )
)
+ CALCULATE (
COUNT ( Table1[Team 2] ),
Table1[Team 2] IN VALUES ( Teams[Team] )
)
Define a new table Teams as follows:
Teams =
DISTINCT ( UNION ( VALUES ( Table1[Team 1] ), VALUES ( Table1[Team 2] ) ) )
Then set up relationships with both Team 1 and Team 2 columns in the model:
You can count both columns like this:
Count =
CALCULATE (
COUNT ( Table1[Team 1] ),
USERELATIONSHIP ( Teams[Team], Table1[Team 1] )
)
+ CALCULATE (
COUNT ( Table1[Team 2] ),
USERELATIONSHIP ( Teams[Team], Table1[Team 2] )
)
You can do it without setting up the relationships too:
Count =
CALCULATE (
COUNT ( Table1[Team 1] ),
Table1[Team 1] IN VALUES ( Teams[Team] )
)
+ CALCULATE (
COUNT ( Table1[Team 2] ),
Table1[Team 2] IN VALUES ( Teams[Team] )
)
@Girish_123 you can use a measure like this
Measure =
VAR _0 =
UNION (
SELECTCOLUMNS ( 'Table', "c1", 'Table'[column1] ),
SELECTCOLUMNS ( 'Table', "c1", 'Table'[column2] )
)
RETURN
MAXX (
ADDCOLUMNS (
'Table 2',
"freq",
MAXX (
FILTER (
ADDCOLUMNS (
_0,
"Frequency", COUNTX ( FILTER ( _0, EARLIER ( [c1] ) = [c1] ), [c1] )
),
[c1] = EARLIER ( 'Table 2'[column1] )
),
[Frequency]
)
),
[freq]
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
10 | |
10 | |
8 | |
7 |