Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Same value showing in two separated columns on matrix table two distinct count

Hi all,

I can't figure out why the matrix is showing a matrix like this

 

with this dax of the addedd column:

Condition Real Time = if(and(OIS[Status]="Certified",and(OIS[MOnthCert] <= 9,month(OIS[10 Date Certified]) <= month(today()))),"Within 9 Months","Longer than 9 months/Not certified yet")

 

While with a slightly different dax expression:

Condition = if(and(OIS[Status]="Certified",OIS[MOnthCert] <= 9),"Within 9 Months","Longer than 9 months/Not certified yet")

 

I got the correct matrix

 

I am scratching my head  but can't figure out were is the issue.

Thank you for helping.

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    I looked at your first dax, do you mean that when the three conditions of OIS[Status]="Certified", OIS[MOnthCert] <= 9, month(OIS[10 Date Certified]) <=month(today()), output "Within 9 Months", and vice versa output "Longer than 9 months/Not certified yet"?

     

    According to the documentation, if you need to perform an AND operation on multiple expressions, it is recommended that you use the AND operator ( &&) to join them all in a simpler expression.
    You can try:

     

    Condition Real Time =
    IF (
        OIS[Status] = "Certified"
            && OIS[MOnthCert] <= 9
            && MONTH ( OIS[10 Date Certified] ) <= MONTH ( TODAY () ),
        "Within 9 Months",
        "Longer than 9 months/Not certified yet"
    )
    
    

     

    Please refer to the following document for more information.

    And (&&) – DAX Guide

    DAX AND OR IN or syntax(&& ||) – Which one? - The Excel Club

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for your reply.

      But it seems not to be working

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

         

        I'm sorry I can't understand your needs, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

         

        Best Regards,

        Neeko Tang

        If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly.