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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Tiitti7
Frequent Visitor

Problems with creating the measure

I need to create a measure that returns the smallest "CostID" value for each distinct ID and ignores all other values.

 

CostID represents the order start date in this case, and there is no separate start date in the data model. In the chart, the X-axis should display the year and month, while the Y-axis should show the order date based on this measure.

 

In this case, there are 2 orders with start dates of 2020-01 and 2020-03.

 

Is that possible? 



Tiitti7_0-1738235512220.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @Tiitti7 

Based on your information, I create a sample table:

vyohuamsft_0-1738546008708.png

Then create new measure and try the following DAX:

SmallestCostID = 
CALCULATE(
    MIN('Table'[CostID]),
    ALLEXCEPT('Table', 'Table'[ID])
)

 

Create visual and put this measure in it, here is my preview:

vyohuamsft_1-1738546114667.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi, @Tiitti7 

Based on your information, I create a sample table:

vyohuamsft_0-1738546008708.png

Then create new measure and try the following DAX:

SmallestCostID = 
CALCULATE(
    MIN('Table'[CostID]),
    ALLEXCEPT('Table', 'Table'[ID])
)

 

Create visual and put this measure in it, here is my preview:

vyohuamsft_1-1738546114667.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

bhanu_gautam
Super User
Super User

@Tiitti7 , Try using ALLEXCEPT

 

MinCostID =
CALCULATE(
MIN(Table[CostID]),
ALLEXCEPT(Table, Table[ID])
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.