cancel
Showing results for 
Search instead for 
Did you mean: 

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

Reply
Berl21
Helper II
Helper II

Time Slicer combined with a measure based on MAX date

Hi,

I am trying to put a visual together where ony the turnover of the latest date per ID gets reported. 

To do this, I wrote the following measure:

Latest Test =

VAR _Summarize=
SUMMARIZE(
'Partition_Rank_SQL',
'Partition_Rank_SQL'[DimOpportunityId],
'Partition_Rank_SQL'[ID_Row],
"MININDEX",
CALCULATE(
MAX(Partition_Rank_SQL[Last_Modified]),
ALLSELECTED('Partition_Rank_SQL'[DimOpportunityId])
),
"LATESTENTRIES",
CALCULATE
(
SUM(Partition_Rank_SQL[Turnover]),
FILTER('Partition_Rank_SQL','Partition_Rank_SQL'[Last_Modified]= MAX(Partition_Rank_SQL[Last_Modified]))
)
)
RETURN
SUMX(_Summarize, [LATESTENTRIES])



Then I added a slicer based on "between", thinking that the latest modification would be taken into account thanks to the MAX statement written in the measure. The calendar table is directly linked to last modified as a column (date= last modified) 

But this still continues to give me all entries between the two dates...where is the problem in the statement?

To be clear, in this example I should have only the value for the 17th of February. I should see the entry for the 14th only if I put the 14th, 15th or 16th of February as my upper limit in my slicer. The goal is to then sum up the turnover of all the latest entries for every id according to the slicer.

Berl21_0-1682968021730.png

Thanks,

Pauline.

 

3 REPLIES 3
Berl21
Helper II
Helper II

Hi @lbendlin 

 

in the slicer I use the date column from my calendar table. But "date" is connected to "last_modified" from the data table. This should not be an issue?

It likely is an issue as that constricts the filter context to existing fact dates. You may need to use a disconnected table for the slicer.

lbendlin
Super User
Super User

Then I added a slicer based on "between", thinking that the latest modification would be taken into account thanks to the MAX statement written in the measure.

How should your data model know that? Did you add the measure as a visual filter to the slicer?

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

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

Power BI Fabric Summit Carousel

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