Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hiya,
I am making some KPI cards, and am wishing to link the target values to the relative date slicer. (weeks, months, etc)
For example, when I choose "Last 2 months", I would like to get a "Previous Month" target.
When I choose "Last 2 weeks", I would like to get a "Previous Week" target.
I could not figure out how to 'extract' that input as some sort of unit to put in a measure.
Help would be much appreciated!
Solved! Go to Solution.
@Anonymous , Try measure like
Last month =
var _max1 = if(isfiltered('Date'),Min( 'Date'[Date]) , today())
var _max = eomonth(_max1,-1)
var _min = eomonth(_max1,-2)+1
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
Last week =
var _max1 = if(isfiltered('Date'),Min( 'Date'[Date]) , today()) -7
var _max = _max1 - weekday(_max,2)+7
var _min = _max1 - weekday(_max,2)+1
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
@Anonymous , Try measure like
Last month =
var _max1 = if(isfiltered('Date'),Min( 'Date'[Date]) , today())
var _max = eomonth(_max1,-1)
var _min = eomonth(_max1,-2)+1
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
Last week =
var _max1 = if(isfiltered('Date'),Min( 'Date'[Date]) , today()) -7
var _max = _max1 - weekday(_max,2)+7
var _min = _max1 - weekday(_max,2)+1
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
16 | |
10 | |
9 | |
7 | |
7 |