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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JothiG
Helper II
Helper II

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])
    )
)
1 ACCEPTED SOLUTION
JothiG
Helper II
Helper II

now its working fine.thank you

View solution in original post

6 REPLIES 6
JothiG
Helper II
Helper II

now its working fine.thank you

JothiG
Helper II
Helper II

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

 

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

ryan_mayu
Super User
Super User

could you pls provide some sample data and expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




FBergamaschi
Solution Sage
Solution Sage

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

yes. blank result

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.