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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.