Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I have two tables similar like below :
Table1
Person CountryID Salary
Sachin Ind 100
Dhoni Ind 200
Messi Arg 300
Nadal Sp 400
Table2
CountryName CountryId
India Ind
Argentina Arg
Spain Sp
Table1 have M:1 relationship with Table2
I want to create Measure using condition Measure=IF(Table2.CountryName="India",Table1.Salary,9999)
I can create this using calculated column but want to create Measure as Table1 is huge.
Thanks
Solved! Go to Solution.
[India Salary] =
IF( SELECTEDVALUE( Table2[CountryName] ) = "India",
SUM( Table1[Salary] ),
9999
)
[India Salary] =
IF( SELECTEDVALUE( Table2[CountryName] ) = "India",
SUM( Table1[Salary] ),
9999
)
Measure=IF(MAX(Table2[CountryName])="India",Sum(Table1[Salary]),9999)
@Milan6687
Please explain a bit more on what exactly you need to calculate. Do you want to get the total salary of all the players if you select India or the maximum, minimum ?
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon on the right if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
I want to calculate total salary of India.
@Milan6687
Try:
Measure = CALCULATE( SUM(Table1.Salary),Table2.CountryName="India")
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon on the right if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Measure=IF(MAX(Table2[CountryName])="India",MAX(Table1[Salary]),9999)
Sorry but why you used MAX?
User | Count |
---|---|
60 | |
22 | |
18 | |
18 | |
16 |
User | Count |
---|---|
87 | |
59 | |
52 | |
38 | |
21 |