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

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

Reply
Thomvdw
Frequent Visitor

Get value based on highest selected period

Hi all,

 

I'am working on a dashboard to show the development of a fleet. The dashboard consists of mainly three components:

1. A slicer to select the period,

2. A KPI that needs to show the value of the last month selected in the sliced,

3. A bar chart that shows the development of the selected months.

Powerbi.JPG

The issue is that when multiple months are selected in order to show a proper development of the fleet in the bar chart, the KPI card show the sum of the selected months. I aim to show in the KPI card only the last selected month of the slicer input.

 

The fields I use are:

1. PeriodID

2. Actuals (this consists the value to represent)

 

In the KPI card and bar chart I use filters to show the correct data.

 

I tried to write a measure for this, but I was unable to have it working. Hope somebody knows the answer.

 

Thanks in advance,

 

Thom

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Something like 

CALCULATE(sum(table[field]),Filter(table,table[period]=MAX(Kalender[Period])))
 
Filter(table,table[period]=MAX(Kalender[Period])) == FROM your table you want only the values which have the MAX values in your kalender. When your filter changes the max value will change
 
From those values you want the sum of a certain field

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Thomvdw , Try like

measure =
var _max = maxx(allselected(period), Period[period])
return
calculate([goal], filter(Period, Period[period] =_max))

 

or

 

measure =
var _max = maxx(allselected(period), Period[period])
return
calculate([goal], filter(Table, Table[period] =_max))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Something like 

CALCULATE(sum(table[field]),Filter(table,table[period]=MAX(Kalender[Period])))
 
Filter(table,table[period]=MAX(Kalender[Period])) == FROM your table you want only the values which have the MAX values in your kalender. When your filter changes the max value will change
 
From those values you want the sum of a certain field

Many thanks Remyo, your solution worked for me!

 

Thanks for your quick reply!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors
Top Kudoed Authors