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
FZOU
Helper IV
Helper IV

MAX and MIN for runing total

Hello,

table.JPG

i have 2 tables stock and demand who have relation with a DimDate, in stock table i have a calculated measure (cumulative stock), in demand table i have a calculated measure (cumulative demand), after that i added a new measure Delta which is (Delta=cumulative stock-cumulative demand) until now everything is ok,to resume here is the 3 measures.

 

-CumStock = CALCULATE(SUM('Stock'[StockVal]),FILTER(ALLSELECTED(DimDate),DimDate[Date]<=max(DimDate[Date])))
-CumDemand = CALCULATE(SUM(Demand[DemandVal]),FILTER(ALLSELECTED(DimDate),DimDate[Date]<=max(DimDate[Date])))
-Delta(CumStock-CumDemand) = Stock[CumStock]-[CumDemand]

 

next step is to calculate the (MAX,MIN,JuneValue) per year of the measure Delta,but i tried several formula and i can't get it because delta is a measure not a column,even with maxx minx it didn't work, so any help please ?

 

to be more clear the wanted result for exp :

 

for the year 2019 is : MAX(9),MIN(-13),June(-12)

for the year 2020 is : MAX(40),MIN(2),June(40)

for the year 2021 is : MAX(71),MIN(38),June(55)

 

Drive Link to the pbix file :

https://drive.google.com/file/d/1_JdOaPobfxguf5dcy43EmEmIe8TvM2_a/view?usp=sharing

 

Thank you 🙂

 

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

J'espère que c'est tout ce que tu veux.

 

CNENFRNL_0-1649854586890.png

 

D'allieur, les Excel Worksheet Formulas sont assez puissants.

CNENFRNL_1-1649855550299.png


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

2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

J'espère que c'est tout ce que tu veux.

 

CNENFRNL_0-1649854586890.png

 

D'allieur, les Excel Worksheet Formulas sont assez puissants.

CNENFRNL_1-1649855550299.png


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!

FZOU
Helper IV
Helper IV

Any help please ?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Solution Authors
Top Kudoed Authors