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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Smackcat
Helper I
Helper I

Min of a column, when a variable is zero

Hi experts,

 

I have a complex table, but I have summarized it as the following:

 

 

 

SUMMARIZE(Table,Table[Period],"Sales",SUM(Table[Sales_unit]))

 

 

 

So now I have:

 

PeriodSales
2023100
2022100
20210

 

I want a measure, that shows me the [Period] when [Sales] = 0 (in the example, the answer is 2021). I was trying with minx

 

 

 

MINX(FILTER(SUMMARIZE(Table,Table[Period],"Sales_unit",SUM(Table[Sales_unit])),[Sales] = 0),[Period])

 

 

 

But this measure shows me a dynamic range that is not the wanted result 😞

 

Any help is appreciated. Thanks

1 REPLY 1
amitchandak
Super User
Super User

@Smackcat , You should use sales in the sum,

 

MINX(FILTER(SUMMARIZE(Table,Table[Period],"Sales_unit",SUM(Table[sales])),[Sales_unit] = 0),[Period])

 

of you can use all or allselected

 

MINX(FILTER(SUMMARIZE(all(Table) ,Table[Period],"Sales_unit",SUM(Table[sales])),[Sales_unit] = 0),[Period])

 

or

 

MINX(FILTER(SUMMARIZE(allselected(Table) ,Table[Period],"Sales_unit",SUM(Table[sales])),[Sales_unit] = 0),[Period])

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.