Forum Discussion

JothiG's avatar
JothiG
Helper III
1 year ago
Solved

Dax not working

Hi, 
Anyone can explain to me below DAX is not working and can give correct one.
 
CALCULATE(
    SUM(Stock_dtl[Net_sales]),
    filter(all(stock_dtl),Stock_dtl[Fin_year] = max(Stock_dtl[Fin_year]) &&
    Stock_dtl[date_sorter] =MAX(Stock_dtl[date_sorter])
    )
)

6 Replies

  • Hi JothiG 

    what do you mean it does not work? Is the result a blank? Is the result not what you are exprcting?

     

    Please include, in a usable format, not an image, a small set of rows for each of the tables involved in your request and show the data model in a picture, so that we can import the tables in Power BI and reproduce the data model. The subset of rows you provide, even is just a subset of the original tables, must cover your issue or question completely. Do not include sensitive information and do not include anything that is unrelated to the issue or question. Please show the expected outcome based on the sample data you provided and make sure, in case you show a Power BI visual, to clarify the columns used in the grouping sections of the visual.

     

    Need help uploading data? click here

     

    Want faster answers? click here

  • could you pls provide some sample data and expected output?

  • still its not working. it is working for single condition either year or month. it's not working for both the condition.

     

    • JothiG's avatar
      JothiG
      Helper III

      hi. understood my mistake. above logic is working fine. thank you.

  • now its working fine.thank you