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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
NDDD
Helper I
Helper I

Same DAX formula not providing correct result

Good day, 

 

 I have exactly same DAX for Var and Total cost to provide the best plant. When used Var cost plant is not correct vs Total cost where result is as expected.

 

LOCATION = VAR MinPrice = CALCULATE ( MIN(COST[TOTAL_COST]) )

RETURN CALCULATE ( MIN ( COST[LOCATION]), FILTER ( ALLEXCEPT ( COST, COST[LOCATION]), COST[TOTAL_COST]= MinPrice ) )

 

Thank you

 

1 ACCEPTED SOLUTION
NDDD
Helper I
Helper I

Good day, 

 

 First thank you, find a solution, changed dax to 

= CALCULATE(MIN(COST[LOCATION]),TOPN(1, COST , COST[$],ASC))

issue was two $ values are equal and seems BI pulled first in line value instead correct one 

View solution in original post

2 REPLIES 2
NDDD
Helper I
Helper I

Good day, 

 

 First thank you, find a solution, changed dax to 

= CALCULATE(MIN(COST[LOCATION]),TOPN(1, COST , COST[$],ASC))

issue was two $ values are equal and seems BI pulled first in line value instead correct one 

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.