Forum Discussion

tbobolz's avatar
tbobolz
Resolver I
6 years ago
Solved

Simple IF statement not working. Help please!!!

Hi All,   I have used this system to auto find the current fiscal year many times in the past; however, today I just can't figure out why it is not working! The column in the below pbix file, "IsMa...
  • MattAllington's avatar
    6 years ago

    DAX is a challenging language to learn.  It seems straight forward but it is like an onion - the more you peel back the layers, the more you find new layers.

     

    Here is the formula you seek

    IsMaxCFY = if('Registration - Export'[Fiscal Year]=MAX('Registration - Export'[Fiscal Year]),1,0)
     
    The issue is complex and has to do with context transition.

     

    There are lots of things I would recommend you do differently.  Perhaps work through the knowledge base on my website

    https://exceleratorbi.com.au/knowledge-base/

     

    Be sure to read the best practices https://exceleratorbi.com.au/best-practices-power-pivot-power-query-power-bi/