Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Sedos101
Helper I
Helper I

Web2 error

Hi everyone

 

Trying to copy and paste into this formula into DAX and powerBI keeps crashing, I can't even type it in...

 

HRI_ =
IF (
MAX ( Data[MANAGEMENT_PT] = 0 ),
1,
(
IF (
MAX ( Data[MANAGEMENT_PT] = 1 )
|| MAX ( Data[MANAGEMENT_PT] = 2 ),
2,
(
IF (
MAX ( Data[MANAGEMENT_PT] = 3 )
|| MAX ( Data[MANAGEMENT_PT] = 4 ),
3,
(
IF (
MAX ( Data[MANAGEMENT_PT] = 5 )
|| MAX ( Data[MANAGEMENT_PT] = 6 ),
4,
(
IF (
MAX ( Data[MANAGEMENT_PT] = 7 )
|| MAX ( Data[MANAGEMENT_PT] = 8 ),
5,
(
IF (
MAX ( Data[MANAGEMENT_PT] = 9 )
|| MAX ( Data[MANAGEMENT_PT] = 10 ),
6,
(
IF (
MAX ( Data[MANAGEMENT_PT] >= 11 )
&& MAX ( Data[MANAGEMENT_PT] <= 13 ),
7,
(
IF (
MAX ( Data[MANAGEMENT_PT] >= 14 )
&& MAX ( Data[MANAGEMENT_PT] <= 16 ),
8,
(
IF (
MAX ( Data[MANAGEMENT_PT] >= 17 )
&& MAX ( Data[MANAGEMENT_PT] <= 19 ),
9,
(
IF (
MAX ( Data[MANAGEMENT_PT] >= 20 ),
10,
(
IF (
MAX ( Data[MANAGEMENT_PT] = 1 )
|| MAX ( Data[MANAGEMENT_PT] = 2 )
|| MAX ( Data[WARNING_PT] = 1 ),
2,
(
IF (
MAX ( Data[MANAGEMENT_PT] = 3 )
|| MAX ( Data[MANAGEMENT_PT] = 4 )
|| MAX ( Data[WARNING_PT] = 2 ),
3,
(
IF (
MAX ( Data[MANAGEMENT_PT] = 5 )
|| MAX ( Data[MANAGEMENT_PT] = 6 )
|| MAX ( Data[WARNING_PT] = 3 ),
4,
(
IF (
MAX ( Data[MANAGEMENT_PT] = 7 )
|| MAX ( Data[MANAGEMENT_PT] = 8 )
|| MAX ( Data[WARNING_PT] >= 4 )
&& MAX ( Data[WARNING_PT] <= 6 ),
5,
(
IF (
MAX ( Data[MANAGEMENT_PT] = 9 )
|| MAX ( Data[MANAGEMENT_PT] = 10 )
|| MAX ( Data[WARNING_PT] >= 7 )
&& MAX ( Data[WARNING_PT] <= 9 ),
6,
(
IF (
MAX ( Data[MANAGEMENT_PT] >= 11 )
&& MAX ( Data[MANAGEMENT_PT] <= 13 )
|| MAX ( Data[WARNING_PT] >= 10 )
&& MAX ( Data[WARNING_PT] <= 12 ),
7,
(
IF (
MAX ( Data[MANAGEMENT_PT] >= 14 )
&& MAX ( Data[MANAGEMENT_PT] <= 16 )
|| MAX ( Data[WARNING_PT] >= 13 )
&& MAX ( Data[WARNING_PT] <= 15 ),
8,
(
IF (
MAX ( Data[MANAGEMENT_PT] >= 17 )
&& MAX ( Data[MANAGEMENT_PT] <= 19 )
|| MAX ( Data[WARNING_PT] >= 16 )
&& MAX ( Data[WARNING_PT] <= 18 ),
9,
(
IF (
MAX ( Data[MANAGEMENT_PT] >= 20 )
|| MAX ( Data[WARNING_PT] >= 19 ),
10,
(
IF (
MAX ( Data[MANAGEMENT_PT] >= 14 )
&& MAX ( Data[MANAGEMENT_PT] <= 16 )
|| MAX ( Data[WARNING_PT] >= 13 )
&& MAX ( Data[WARNING_PT] <= 15 )
|| MAX ( Data[ACTION_PT] >= 1 )
&& MAX ( Data[ACTION_PT] <= 3 ),
8,
(
IF (
MAX ( Data[MANAGEMENT_PT] >= 17 )
&& MAX ( Data[MANAGEMENT_PT] <= 19 )
|| MAX ( Data[WARNING_PT] >= 16 )
&& MAX ( Data[WARNING_PT] <= 18 )
|| MAX ( Data[ACTION_PT] >= 4 )
&& MAX ( Data[ACTION_PT] <= 6 ),
9,
(
IF (
MAX ( Data[MANAGEMENT_PT] >= 20 )
|| MAX ( Data[WARNING_PT] >= 19 )
|| MAX ( Data[ACTION_PT] >= 7 ),
10,
0
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @Sedos101 ,

Your dax statement is too cumbersome, thus causing the error. Referring to below, I copied some of the code in and to the naked eye, it gets more and more jerky as the code grows. Try to optimize your code and try again, you can use SWITCH instead of IF to use.

vluwangmsft_0-1665542952892.png

 

 

Best Regards

Lucien

 

View solution in original post

1 REPLY 1
v-luwang-msft
Community Support
Community Support

Hi @Sedos101 ,

Your dax statement is too cumbersome, thus causing the error. Referring to below, I copied some of the code in and to the naked eye, it gets more and more jerky as the code grows. Try to optimize your code and try again, you can use SWITCH instead of IF to use.

vluwangmsft_0-1665542952892.png

 

 

Best Regards

Lucien

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.