Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I don't know how to solve, maybe someone can help.
This is a part from my FAC_Fraud_Schade table
And this is the measure I try to create. I want to look 13 months back and from those 13 months I want the highest month value.
So if for the month of September the SUM(Aan klant vergoed) is 50.000 and also the highest of all months, I want the measure to return 50.000.
Actually I want the month with the highest value of 'Aan klant vergoed' - 'Voor klant verhaald'.
But already working with one measure gives me trouble.
Solved! Go to Solution.
hmm this look tricky i made a sample dataset
and a caleendar tabel
first i created the measure for per month - year
Total Amount by month =
CALCULATE(SUM('Table'[Amount]),ALLEXCEPT('Date','Date'[Month - Year]))
next i made a measure to find the past 13 months
Locate past 13 month =
VAR _min = EOMONTH(CALCULATE(MAX('Date'[Date]),ALL('Date')),-13)
VAR _max = CALCULATE(MAX('Date'[Date]),ALL('Date'))
RETURN
if( MIN('Date'[Date]) >=_min && MAX('Date'[Date]) <=_max , 1 , 0)
next i made a measure to find the maxx inside this window
Max Amount =
VAR _t =
SUMMARIZE(
FILTER(
'Date',[Locate past 13 month] = 1),'Date'[Month - Year],"Amount",[Total Amount by month])
RETURN
MAXX(_t,[Amount])
and if you want the columsn to show last results just use
MAX Amount =
VAR MaxValue =
CALCULATE(
MAXX(
FILTER(
ALL('Table'),
'Table'[Locate past 13 month] = 1
),
[Total Amount by month]
)
)
RETURN
MaxValue
final result
Thnx @eliasayyy
I got it working. Understand what you are doing, but still fin dit hard to find out myself.
The issue her of course is also that you don't want the MAX of the whole dataset, but just the MAX of the last 13 months, while the dataset contains 4 years of data.
Thnx for helping me out
Hi @eliasayyy thnx for the great effort. Somewhere this week, hopefully asap, I will test it on my dataset and then let you know.
hmm this look tricky i made a sample dataset
and a caleendar tabel
first i created the measure for per month - year
Total Amount by month =
CALCULATE(SUM('Table'[Amount]),ALLEXCEPT('Date','Date'[Month - Year]))
next i made a measure to find the past 13 months
Locate past 13 month =
VAR _min = EOMONTH(CALCULATE(MAX('Date'[Date]),ALL('Date')),-13)
VAR _max = CALCULATE(MAX('Date'[Date]),ALL('Date'))
RETURN
if( MIN('Date'[Date]) >=_min && MAX('Date'[Date]) <=_max , 1 , 0)
next i made a measure to find the maxx inside this window
Max Amount =
VAR _t =
SUMMARIZE(
FILTER(
'Date',[Locate past 13 month] = 1),'Date'[Month - Year],"Amount",[Total Amount by month])
RETURN
MAXX(_t,[Amount])
and if you want the columsn to show last results just use
MAX Amount =
VAR MaxValue =
CALCULATE(
MAXX(
FILTER(
ALL('Table'),
'Table'[Locate past 13 month] = 1
),
[Total Amount by month]
)
)
RETURN
MaxValue
final result
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |