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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors