Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
In power BI i want to filter by Team A's Bangalore and want Winning % of Bangalore as Team A. i.e. if i Filter with Bangalore from Team A i want (Winner/Team A)*100 which shows me the winning % of Bangalore also it should match the exact figure if i filter it with Year. This Data set is just an Example of of my Question, my actual data set is sensitive and very huge so can't post it here. Also Team A column belongs from a different table and Winner Belongs from a different table. So how can i create a Dax Query for this ?
Thanks and Regards,
Rohit Binnani
Hi @rohitbinnani,
Since column [Team A] belongs from a different table and [Winner] comes from another table, you should first combine them into a single table based on specific relationship.
As I don't know what relationship is between the original two tables, suppose the combination table looks like above you posted. And there are two slicers in your report, one is for [Team A], another is for [Year]. In that case, please create measures like:
CountSelectedWinner = CALCULATE ( COUNTA ( 'Game Winning'[Winner] ), FILTER ( 'Game Winning', 'Game Winning'[Winner] = LASTNONBLANK ( 'Game Winning'[Team A], 1 ) ) )
CountTeamA =
CALCULATE (
COUNTA ( 'Game Winning'[Team A] ),
FILTER (
'Game Winning',
'Game Winning'[Team A] = LASTNONBLANK ( 'Game Winning'[Team A], 1 )
)
)
Winning% = [CountSelectedWinner]/[CountTeamA]
If I have something misunderstood, please provide more description about your requirement.
Thanks,
Yuliana Gu
Hi @v-yulgu-msft,
i tried it with different table. what if my filter of Team A is in and connected in this table as per a primary key. we have team A in this table itself but i have another dimension from which i am bringing my Team A as filter just because that is also connected to some more tables to filter them too. can you help me in this ?
the script you provided works perfect if they belong from same table. !!!
Regards,
Rohit Binnani.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
93 | |
75 | |
62 | |
50 |
User | Count |
---|---|
147 | |
107 | |
105 | |
87 | |
61 |