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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.