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 there
I need help with DAX formula for the following logic
IF Income is in Group1 & Income > x, then [VALUE],
IF Income is in Group2 & Income > x, then [VALUE],
IF Income is in Group3 & Income > x, then [VALUE]
Your assistance would be greatly appreciated.
Solved! Go to Solution.
Hi @Anonymous ,
You can try formul like below:
Result =
IF (
'Table'[Income] > 1500,
IF (
'Table'[Group] = "Group1",
"result1",
IF (
'Table'[Group] = "Group2",
"result2",
IF ( 'Table'[Group] = "Group3", "result3" )
)
),
"<1500"
)
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
You can try formul like below:
Result =
IF (
'Table'[Income] > 1500,
IF (
'Table'[Group] = "Group1",
"result1",
IF (
'Table'[Group] = "Group2",
"result2",
IF ( 'Table'[Group] = "Group3", "result3" )
)
),
"<1500"
)
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you very much,
however when I run this I receive a "Expressions that yield variant data-type cannot be used to define calculated columns" error.
Any suggestions on how to get around this?
@Anonymous , You Can create a new column using Switch true
Switch(True() ,
[Income Group] = "Group1" && [Income] < 1000 , "Value1" ,
[Income Group] = "Group2" && [Income] < 1000 , "Value2" ,
[Income Group] = "Group3" && [Income] < 1000 , "Value3"
)
Switch-Case statement of #PowerBI: https://www.youtube.com/watch?v=gelJWktlR80&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=56
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |