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! Learn more

Reply
love
Helper I
Helper I

How to return min value for different groups of data

Hello.

 

I am working with a set of data simliar to this:

 

TASK	CONFIG	    ID	EXPECTED OUTPUT
Task A	Config A    1 	1
Task A	Config A    2	1
Task A	Config A    3	1
Task A	Config B    4	4
Task A	Config B    5	4
Task A	Config B    6	4
Task B	Config A    7	7
Task B	Config A    8	7
Task B	Config A    9	7
Task B	Config B   10	10
Task B	Config B   11	10
Task B	Config B   12	10

 

My problem is: how do i get the EXPECTED OUTPUT value?

EXPECTED OUTPUT = The lowest ID for each existing combination of TASK and CONFIG

I need this either as a NEW COLUMN or via Power Query M instead of DAX. It can't be a CALCULATED MEASURE because I need to change the datacategory of the EXPECTED OUTPUT to be a Web URL, which is not possible with calculated measures.

 

After that I would like to hide the ID value from a "Table" visualisiation and just have this left:

TASK	CONFIG	    EXPECTED OUTPUT
Task A	Config A    1
Task A	Config B    4
Task B	Config A    7
Task B	Config B    10

 

Thank you.

1 ACCEPTED SOLUTION

HI @love

 

Try this

 

Column =
CALCULATE (
    MIN ( TableName[ID] ),
    ALLEXCEPT ( TableName, TableName[TASK], TableName[CONFIG] )
)

View solution in original post

4 REPLIES 4
love
Helper I
Helper I

/friendly push Cat Happy

HI @love

 

Try this

 

Column =
CALCULATE (
    MIN ( TableName[ID] ),
    ALLEXCEPT ( TableName, TableName[TASK], TableName[CONFIG] )
)

@love

 

Using Power Query / Query  Editor

 

Go to Transform Tab>>>Group By>>Advanced

 

See the pic below

 

PQGroup.png

Hi @Zubair_Muhammad

 

Both of your suggested solutions perfectly meet the requirements in my OP, thank you very much for the uncomplicated and elegand suggestions! 

 

I ended up going for the DAX solution because if I use the "Group by" solution in the query editor the grouping actually removes all lines that do not have the MIN(ID) which is not what I want but I see that I did not make that very clear in my OP.

 

Thanks again! Smiley Happy

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.