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 need to replicate this formula from Excel to DAX as a Measure but not sure how:
=+IF(K6<-50000,"High Risk",IF(L6<-0.9%,"Medium Risk","No Risk"))
I tried this way but is showing wrong in the pivot table: When i drag the measure into the pivot table it shows like a breakdown but I don't want that. I need to evaluate same way like in Excel.
Could you help me ?
Thanks !
Solved! Go to Solution.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Your logic always returns at least "No Risk", so it is added rows that would normally be blank (and be auto filtered from the visual). Please try this expression instead (correct the logic if incorrect, but it will return the result for the first one that is true).
New Measure =
SWITCH (
TRUE (),
[Var CCI] <= 50000, "High Risk",
[Var CCI%] < 0.9, "Medium Risk",
NOT ( ISBLANK ( [Var CCI] ) ), "No Risk",
BLANK ()
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi @AllisonKennedy ,
I tried that using "blank" but is not working. I think that is not the solution. I only have 35 lines and the problem is that when I drag the measure into the pivot table it shows 1260 lines and that is not what I spect. I think the issue is how I need to evaluate the information in the model.
See the difference:
Before use the measure:
After:
Your logic always returns at least "No Risk", so it is added rows that would normally be blank (and be auto filtered from the visual). Please try this expression instead (correct the logic if incorrect, but it will return the result for the first one that is true).
New Measure =
SWITCH (
TRUE (),
[Var CCI] <= 50000, "High Risk",
[Var CCI%] < 0.9, "Medium Risk",
NOT ( ISBLANK ( [Var CCI] ) ), "No Risk",
BLANK ()
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi @AllisonKennedy ,
Actually there is a relationship for Contract Name and Contract Number. I created Lists from an append table to do relationships for each category of the tables:
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
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.