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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ilyakoslov
Frequent Visitor

How to get the minx value of the last 12 months of a measure.

Hello guys,

 

so I would like to know how do I get the minx value of a measure from the last 12 months and make it dynamic, based on what date the user chooses. Let's say he picks december, power bi would look 12 months before that for the time where the measure was in it's lowest value. 

 

I have a Calendar table, a cost table and a revenue table. The measure of which I want to show the user is the division between both. 

So Measure[% CR] divides cost by revenue. And I would like to show the user the value of this measure when it was on it's lowest. 

 

Can someone help? Thanks!!

1 ACCEPTED SOLUTION

I solved it check it out

 

PMR Ref =
    MINX (
        FILTER (
            ALL ( 'Calendario' ),
            'Calendario'[Data] >= DATEADD ( 'Calendario'[Data], -12, MONTH )
                && 'Calendario'[Data] <= MAX ( 'Calendario'[Data] )
        ),
        [PMR]
    )

View solution in original post

3 REPLIES 3
FreemanZ
Super User
Super User

You would need DATESINPERIOD, as the filter argument of your calculation. check this

https://learn.microsoft.com/en-us/dax/datesinperiod-function-dax

I solved it check it out

 

PMR Ref =
    MINX (
        FILTER (
            ALL ( 'Calendario' ),
            'Calendario'[Data] >= DATEADD ( 'Calendario'[Data], -12, MONTH )
                && 'Calendario'[Data] <= MAX ( 'Calendario'[Data] )
        ),
        [PMR]
    )

congratulations. Harnessing the flexibility of DATEADD, you can solve most of the Time Intelligence relevant issue. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.