question

CarinMansfield-2636 avatar image
0 Votes"
CarinMansfield-2636 asked Lz-3068 commented

I am trying to find the error in the following syntax in which I am trying to use in Power Bi. This formula gives me an "ERROR".

Hi, I am trying to find the error in the following syntax in which I am trying to use in Power Bi. This formula gives me an "ERROR".
This is a Dax function Please assist.

Logged Quarter = IF(OR(MONTH('Case Data'[Date Logged])=7,MONTH('Case Data'[Date Logged])=8),MONTH('Case Data'[Date Logged])=9,"Q1", IF(OR(MONTH('Case Data'[Date Logged])=10,MONTH('Case Data'[Date Logged])=11,MONTH('Case Data'[Date Logged])=12),"Q2", IF(OR(MONTH('Case Data'[Date Logged])=1,MONTH('Case Data'[Date Logged])=2,MONTH('Case Data'[Date Logged])=3),"Q3", IF(OR(MONTH('Case Data'[Date Logged])=4,MONTH('Case Data'[Date Logged])=5,MONTH('Case Data'[Date Logged])=6),"Q4","unknown"))))

Thank you in advance.

power-query-not-supported
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Lz-3068 avatar image
0 Votes"
Lz-3068 answered Lz-3068 commented

Hi @CarinMansfield-2636

The following alternative does what you expect:
=
VAR month =
MONTH ( 'Case Data'[Date Logged] )
RETURN
SWITCH (
TRUE (),
AND ( month >= 7, month <= 9 ), "Q1",
AND ( month >= 10, month <= 12 ), "Q2",
AND ( month >= 1, month <= 3 ), "Q3",
AND ( month >= 4, month <= 6 ), "Q4",
"Unknown"
)

When you raise an issue please explain what you expect to achieve. That one was easy but that's rarely the case and if contributors to the forum to know/understand what the context is and what the expected result is, you'll likely get 0 answer. Hope this makes sense

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @CarinMansfield-2636

Assuming the above proposal did what I want there's an Accept as Answer link/button that can help those who search for existing solutions

Thanks in advance & any issue with the above proposed solution please let me know
Nice day...

0 Votes 0 ·