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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
fernando_solis
Frequent Visitor

Select the most recent value based on a slicer period

Hi everyone,

 

I am building a model which displays the electricity prices, demand and expenditure on a determined region. I am using a map to achieve this goal. Currently, the map that I have already built shows the location of different nodes, the name of those nodes and the average expenditure and average demand of each one of them. The map is connected to a date slicer, which I use to select the desired date range of all this data. 

 

One of the requirements is to always show the latest monthly price on each node, based, of course, on the date range selected in the slicer, for example:

 

Date Range (Slicer)          NodeName      Avg(expenditure)     Avg(demand)      LatestPrice (January 2018 price)

2017-01-01 / 2018-01-31 qwerty 12345.69 789456.32 1.89

 

 

I have all this data stored in one single table that looks like this:

 

Date               NodeName                Expenditure             Demand              Price
2017-01-01 qwerty 123.65 321.21 0.56
2017-02-01 abc 321.56 135.98 0.89
...
2018-01-01 qwerty 5489.4 546.68 1.89

I am sure that there is a DAX solution for this, I have tried some that I have found in this forum but none of them have worked 😞

 

I would really appreciate your help!

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@fernando_solis

 

May be somehting on this pattern

 

Measure =
CALCULATE ( MAX ( TableName[Price] ), LASTDATE ( TableName[Date] ) )

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@fernando_solis

 

May be somehting on this pattern

 

Measure =
CALCULATE ( MAX ( TableName[Price] ), LASTDATE ( TableName[Date] ) )

Regards
Zubair

Please try my custom visuals

@Zubair_Muhammad

 

Thank you so much! This was what I was looking for!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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