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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Need Help to write If statements in DAX

Hi Team,

 Greetings !!

 

Below is my statement which i am using in a different BI tool , I have create the same formula here , can some one help me here .
IF [Fcst]="CQ" and
([SS no]="07" or [SS no]="08")
and [Week Num]= {MAX(IF [Fcst]='CQ' THEN [Week Num] ELSE null END)}
then [Rev$M] ELSE 0 END

Thanks & Regards

Shiv Kumar

1 ACCEPTED SOLUTION
Arul
Super User
Super User

@Anonymous ,

 

I tried to replicate your formula in Power BI. Please check and let me know if it helps or not.

If statement = IF(and(AND([Fcst]="CQ",OR([SS no]="07",[SS no]="08")),[Week Num]= MAX(IF( [Fcst]='CQ',[Week Num],BLANK()))),[Rev$M],0)

 

Thanks,

Arul





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

I don't understand the MAX section in your original formula {MAX(IF [Fcst]='CQ' THEN [Week Num] ELSE null END)}. Can you explain it with natural language or some sample data to help us understand the expected result? The usage of MAX function in Power BI is different from this one, so there is a gap for understanding here.

 

Best Regards,
Community Support Team _ Jing

Arul
Super User
Super User

@Anonymous ,

 

I tried to replicate your formula in Power BI. Please check and let me know if it helps or not.

If statement = IF(and(AND([Fcst]="CQ",OR([SS no]="07",[SS no]="08")),[Week Num]= MAX(IF( [Fcst]='CQ',[Week Num],BLANK()))),[Rev$M],0)

 

Thanks,

Arul





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


Anonymous
Not applicable

HI Arul @Arul ,

Thanks for replying!!

I have updated the formula a little .

CYCQCW-Win Rev = IF(and(AND([Fcst]="CQ",OR([SS_No]="07",[SS_No]="08")),[WEEK_NUM]= MAX(IF( [Fcst]="CQ",[WEEK_NUM],BLANK()))),[Rev$M],0)

2 issues i am facing here ,
  1. If I click on new measure and pasting the above formula its not at recognising the columns like FCST or Week Num .
  2. if I click on new column and paste it , here is the error what i am getting : "The Max function only accepts a column reference as an argument.

Thanks & Regards

Shiv

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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