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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Untangle this crazy condtional DAX statement

This a fine community that has taught me a lot.  Thanks for your help on this one.

 

I have generally used short single purpose DAX statements and am what one might call a low-intermediate in DAX.  I would love some help untangling this huge crazy DAX formula my predicessor left as some sort of conditional statement in an Excel cell.

 

In reverse engineering this I have come across some aspects of the formula syntax I haven't seen nor have come to a conclusion after 6 hours of internet searching.

 

I first thought this was a nested if statement, but don't see 'If" and the only DAX function I see is "AND".   I can see a pattern of conditions but it doesn't look like nesting that I know of.  

Here is the basic pattern:  

 

=AND([@[Allocated Salary]]>0, [@[Revised Salary]]=0, [@[Change Effective Date]]=0, [@[End Date]]=0, 'Controls'!$D$4=0, 'Controls'!$E$4=0) [@[Allocated Salary]]/'US Working Days'!$E$3*'US Working Days'!$B$2 AND . . . 

 

It quasi repeats with different conditions.

The whole statement in the cell is pasted below.

 

Things that puzzle me:

1.  What is the significance of the space between the ") ["  that I highlighted in orange below?

 

2.  Similiarly, I find that space to include a '0' sometimes (highlighed in blue below?

 

3.  Is this even DAX?

 

What is going on in this huge statement?

 

=AND([@[Allocated Salary]]>0,
[@[Revised Salary]]=0,
[@[Change Effective Date]]=0,
[@[End Date]]=0,
'Controls'!$D$4=0,
'Controls'!$E$4=0) [@[Allocated Salary]]/'US Working Days'!$E$3*'US Working Days'!$B$2 AND([@[Allocated Salary]]>0,
[@[Revised Salary]]>=0,
[@[Change Effective Date]]>$AE$1,
[@[End Date]]<=$AE$1,
'Controls'!$D$4=0,
'Controls'!$E$4=0) [@[Allocated Salary]]/'US Working Days'!$E$3*'US Working Days'!$B$2 AND([@[Allocated Salary]]>0,
[@[Revised Salary]]>0,
[@[Change Effective Date]]=0,
[@[End Date]]=0,
'Controls'!$D$4=0,
'Controls'!$E$4=0) [@[Allocated Salary]]/'US Working Days'!$E$3*'US Working Days'!$B$2 AND([@[Allocated Salary]]>0,
[@[Revised Salary]]>0,
[@[Change Effective Date]]>=$AE$1,
[@[End Date]]=0,
'Controls'!$D$4=0,
'Controls'!$E$4=0) [@[Revised Salary]]/'US Working Days'!$E$3*'US Working Days'!$B$2 AND([@[Allocated Salary]]>0,
[@[Revised Salary]]>0,
[@[Change Effective Date]]<=$AE$1,
[@[End Date]]=0,
'Controls'!$D$4=0,
'Controls'!$E$4=0) [@[Revised Salary]]/'US Working Days'!$E$3*'US Working Days'!$B$2 AND([@[Allocated Salary]]>0,
[@[Revised Salary]]>=0,
[@[Change Effective Date]]=0,
[@[End Date]]<=$AE$1,
'Controls'!$D$4=0,
'Controls'!$E$4=0) 0 AND([@[Allocated Salary]]>0,
[@[Revised Salary]]>=0,
[@[Change Effective Date]]>=0,
[@[End Date]]<=$AE$1,
'Controls'!$D$4=0,
'Controls'!$E$4=0) 0 AND([@[Allocated Salary]]>0,
[@[Revised Salary]]>=0,
[@[Change Effective Date]]=0,
[@[End Date]]>$AE$1,
'Controls'!$D$4=0,
'Controls'!$E$4=0) [@[Allocated Salary]]/'US Working Days'!$E$3*'US Working Days'!$B$2 AND([@[Allocated Salary]]>0,
[@[Revised Salary]]>=0,
[@[Change Effective Date]]<=$AE$1,
[@[End Date]]>$AE$1,
'Controls'!$D$4=0,
'Controls'!$E$4=0) [@[Revised Salary]]/'US Working Days'!$E$3*'US Working Days'!$B$2 AND([@[Allocated Salary]]>0,
[@[Revised Salary]]>=0,
[@[Change Effective Date]]>$AE$1,
[@[End Date]]>$AE$1,
'Controls'!$D$4=0,
'Controls'!$E$4=0) [@[Allocated Salary]] 

 

 

Thanks for your help in advance.

 

John Napier

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Nope, this isnt DAX. This is an excel formula built using a table.  Which is why you see [@[...]] structure

https://support.office.com/en-us/article/using-structured-references-with-excel-tables-f5ed2452-2337...

 

Good luck trying to figure out what that formula is doing. 

View solution in original post

4 REPLIES 4
kentyler
Solution Sage
Solution Sage

I ran this through the Dax formatter at  daxformatter.com and it doesn't format as DAX





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Anonymous
Not applicable

Oh, the file is a .xlsb (binary workbook).  

Not sure why that file type is used except for performance aspects.

 

Thanks,

Anonymous
Not applicable

Nope, this isnt DAX. This is an excel formula built using a table.  Which is why you see [@[...]] structure

https://support.office.com/en-us/article/using-structured-references-with-excel-tables-f5ed2452-2337...

 

Good luck trying to figure out what that formula is doing. 

Anonymous
Not applicable

Thanks for looking into this, guys.  

I have used basic structured references in Excel, but this method of conditional statement is new to me.  What I figure is this is like a nested IF statement listing the conditions withing the AND() followed by a space and the THEN componant.  I just haven't seen such syntax.  It works though.

 

=AND([@[Allocated Salary]]>0,
[@[Revised Salary]]=0,
[@[Change Effective Date]]=0,
[@[End Date]]=0,
'Controls'!$D$4=0,
'Controls'!$E$4=0) [@[Allocated Salary]]/'US Working Days'!$E$3*'US Working Days'!$B$2

AND([@[Allocated Salary]]>0,
[@[Revised Salary]]>0,
[@[Change Effective Date]]>=$AE$1,
[@[End Date]]=0,
'Controls'!$D$4=0,
'Controls'!$E$4=0) [@[Revised Salary]]/'US Working Days'!$E$3*'US Working Days'!$B$2

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.