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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.