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
marcio_fornari
Resolver I
Resolver I

Get a min from summarise table

Hi Everyone,

How can i get the min value from this table created in Dax:

 

marcio_fornari_0-1628276855026.png

 

EVALUATE
var t = SUMMARIZE(
	F_CUSTO_FRANGO,
	F_CUSTO_FRANGO[Ano-Mes],
	"Total", sum(F_CUSTO_FRANGO[Total Final]
	)
)
return
t

 

I need the min of the sum, i think a a summarize table and get the min, i don't know if is better way..

3 ACCEPTED SOLUTIONS
Jos_Woolley
Solution Sage
Solution Sage

Hi,

You could use this measure:

 

MinSum =
MINX (
    SUMMARIZE (
        F_CUSTO_FRANGO,
        F_CUSTO_FRANGO[Ano-Mes],
        "Total", SUM ( F_CUSTO_FRANGO[Total Final] )
    ),
    [Total]
)

 

Regards

View solution in original post

CNENFRNL
Community Champion
Community Champion

=
MINX(
    SUMMARIZECOLUMNS(
        F_CUSTO_FRANGO[Ano-Mes],
        "@Total", SUM( F_CUSTO_FRANGO[Total Final] )
    ),
    [@Total]
)

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

Fowmy
Super User
Super User

@marcio_fornari 

To aggregate over a virtual table, you can use an iterator function: with the dame code you have, add the following:

EVALUATE
VAR t =
    SUMMARIZE (
        F_CUSTO_FRANGO,
        F_CUSTO_FRANGO[Ano-Mes],
        "Total", SUM ( F_CUSTO_FRANGO[Total Final] )
    )
RETURN
    MINX ( t, [Total] )

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

5 REPLIES 5
vishal097
Helper II
Helper II

Hello All,

 

I have the similar requirement where I want Sum of Minimum QTY in each SFC ( there are multile record at SFC level ) from Summarize Table 

vishal097_3-1662559688831.png

I have tried Measure as 

Units Produced Within Standard Time =
VAR Result =
SUMX(
SUMMARIZE (
Fact_DailyMgmt_ThroughputTime_Detail,
Fact_DailyMgmt_ThroughputTime_Detail[SFC],
Fact_DailyMgmt_ThroughputTime_Detail[START_TIME],
Fact_DailyMgmt_ThroughputTime_Detail[END_TIME],
Fact_DailyMgmt_ThroughputTime_Detail[Wait_Time_Type],
"QTY", FIRSTNONBLANK ( Fact_DailyMgmt_ThroughputTime_Detail[QTY], 0 ),
"IsEligible",
IF (
SUM ( Fact_DailyMgmt_ThroughputTime_Detail[Throughput_Time] )
<= SUM ( Fact_DailyMgmt_ThroughputTime_Detail[ERP_Target] ),
1 , BLANK() ) ) , [QTY] * [IsEligible] )

RETURN

Result
 
but it is giving sum of QTY for all due to which value is not correct 
 
can someone please help.

 

marcio_fornari
Resolver I
Resolver I

Thank you so much everyone! 
it's to easy! OMG 😅

Fowmy
Super User
Super User

@marcio_fornari 

To aggregate over a virtual table, you can use an iterator function: with the dame code you have, add the following:

EVALUATE
VAR t =
    SUMMARIZE (
        F_CUSTO_FRANGO,
        F_CUSTO_FRANGO[Ano-Mes],
        "Total", SUM ( F_CUSTO_FRANGO[Total Final] )
    )
RETURN
    MINX ( t, [Total] )

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

CNENFRNL
Community Champion
Community Champion

=
MINX(
    SUMMARIZECOLUMNS(
        F_CUSTO_FRANGO[Ano-Mes],
        "@Total", SUM( F_CUSTO_FRANGO[Total Final] )
    ),
    [@Total]
)

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Jos_Woolley
Solution Sage
Solution Sage

Hi,

You could use this measure:

 

MinSum =
MINX (
    SUMMARIZE (
        F_CUSTO_FRANGO,
        F_CUSTO_FRANGO[Ano-Mes],
        "Total", SUM ( F_CUSTO_FRANGO[Total Final] )
    ),
    [Total]
)

 

Regards

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.