Forum Discussion

Dhruvkh's avatar
Dhruvkh
New Member
1 year ago
Solved

Dax Query not giving results as expected

Hello guys, I am running this DAX query  EVALUATE   FILTER(Sales, CALCULATE(SUM(Sales[Quantity]),Sales[ProductKey]=1))   I am not getting expected results as per explanation in powerbi document...
  • Tahreem24's avatar
    1 year ago

    Dhruvkh What's the data type of [ProductKey]? If it is text so wrap it inside " " like below:

     

    EVALUATE
      FILTER(Sales, CALCULATE(SUM(Sales[Quantity]),Sales[ProductKey]="1"))
     
     
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Dhruvkh ,

    Thanks for Tahreem24's and MFelix's replies!
    And Dhruvkh , I create sample data myself:

    And here is the result of DAX Query:

     You can check whether your data has something different with my sample data to find the cause of problem.

    Best Regards,
    Dino Tao