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.
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?
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 |
---|---|
44 | |
25 | |
19 | |
16 | |
8 |
User | Count |
---|---|
70 | |
49 | |
45 | |
20 | |
16 |