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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
MaheshDadhich
Helper I
Helper I

DAX Function Help

Hello,

My requirement is to calculate max ExtractDate(Column Name) for each month in dataset after filtering the dataset based on user selected report parameter in Power BI Desktop.

For Example:  

Dataset  :

Plant       Component        material     Month      ExtractDate     Forecast

P1              C1                      M1           201601        5-Jan-16          10

P1              C1                      M2           201601        8-Jan-16          15

P2              C1                      M3           201601        10-Jan-16         20

 

If user select Plant = P1 and Component = C1 and Material = ALL then Max(ExtractDate) should be 8-Jan-16 But I am getting 10-Jan-16

 

How to calculate Max Date dynamically affter filtering the dataset by user selected parameter.

Thanks in Advance for help. Swift help is appreciated

 

Regards,

Mahesh 

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

What visualization are you using for ExtractDate?

 

I created a measure with your formula, used a card for it and slicers for Plant and Component and when I select P1, the max date is the eighth as expected.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks very much for your response !

 
Could you share the measure formula which you applied to get Max date.
 
Thanks 

I used your formula MAX([ExtractDate]).



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

MAX(ExtractDate) will calculate for entire data in Dataset But I need to calculate for every month.
For Example :

 

Plant       Component        material     Month      ExtractDate     Forecast

P1              C1                      M1           201601        5-Jan-16          10

P1              C1                      M2           201601        8-Jan-16          15

P2              C1                      M3           201601        10-Jan-16         20

P1              C1

Please avoid last post as It was bymistake sent while typing

 

MAX(ExtractDate) will calculate for entire data in Dataset But I need to calculate for every month.
For Example :

 

Plant       Component        material     Month      ExtractDate     Forecast

P1              C1                      M1           201601        5-Jan-16          10

P1              C1                      M2           201601        8-Jan-16          15

P2              C1                      M3           201601        10-Jan-16         20

P1              C1                     M4            201602         20-Feb-16       10                                                                  

P1              C1                      M3           201602         22-Feb-16     20 

 

If User select Plant = P1 and Component = C1 and Material = ALL then Result should be 

 

Plant       Component        material     Month      ExtractDate     Forecast         MaxDate

P1              C1                      M1           201601        5-Jan-16          10                8-Jan-16

P1              C1                      M2           201601        8-Jan-16          15                8-Jan-16

P1              C1                     M4            201602         20-Feb-16       10                22-Feb-16                                                  

P1              C1                      M3           201602         22-Feb-16     20                22-Feb-16

 

 

 

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.