cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Frequent Visitor

## DAX - Get the latest value in the week

Hi!

I have this table with Weeks (First Day of Week), Dates and a  DAX Measure

And I want to modify the Measure in order to have a chart and use the Week dimension on it, then show the latest value of each Week, like this:

Thanks

1 ACCEPTED SOLUTION
Community Support

``````Latest Value by Week =
VAR LatestDatebyWeek_ =
CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Week] ) )
RETURN
CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Date] = LatestDatebyWeek_ )
``````
``````Modified Latest Value by Week =
SUMX ( VALUES ( 'Table'[Week] ), [Latest Value by Week] )
``````

Best Regards,

Icey

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 REPLIES 4
Community Support

``````Latest Value by Week =
VAR LatestDatebyWeek_ =
CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Week] ) )
RETURN
CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Date] = LatestDatebyWeek_ )
``````
``````Modified Latest Value by Week =
SUMX ( VALUES ( 'Table'[Week] ), [Latest Value by Week] )
``````

Best Regards,

Icey

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Frequent Visitor

@ribisht17  hi , thanks , but I think I didnt explain well my requeriment:

I need a line chart displaying

X Axis = Week Column

Measure = Only the value of the LAST day of the Week

For example for Week 15/05/2022 the value needs to be 1627

Super User

Rank= RANKX(FILTER(all('Table'),'Rank'[Week]=max('Rank'[Week])),'Rank'[date],,DESC,Dense)

Now Just Filter RANK=1

Regards,

Ritesh

Super User

This should work

Measure=

if(

Rank= RANKX(FILTER(all('Table'),'Rank'[First of Week]=max('Rank'[First of Week])),'Rank'[date],,DESC,Dense)=1,fact,"")

X Axis = First of Week

Regards,

Ritesh

Announcements

#### Power BI Monthly Update - November 2023

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

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors