Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Is there anyway to build a measure that would give you the current period vs the previous period, based on a relative filter.
For eaxmple if the filter is set to last 30 days it would show the last 30 days minus days 31-60, a separate measure that just shows days 31-60
Then if you changed the relative filter to last 60, it would show it minus days 61-120, a separate measure that just shows days 61-120
If it's not possible with just 2 measures is there a neat way so I can have a number of different similar measures and use bookmarks to change the view of it?
Hi @jlf81,
Any update on your scenario? You only shared less information so that we not clarify your structure and do the test with them.
Regards,
Xiaoxin Sheng
@amitchandak Awesome, thank you.
Is there any way to edit that to deal with YTD\MTD? or would I need to adjust that measure
Little typo in you solution 'var _min =maxx(date,date[date])' should be 'var _min =minx(date,date[date])' shouldn't it? Also couldn't get that last bit to work, but replaced it with ,DATESBETWEEN('Dim Date'[Date],_minX,_maxX))) and that seems ok
Hi @jlf81,
Can you please share some dummy data with a similar data structure and expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
@jlf81 , Try a measure like
Last Period =
var _max =maxx(date,date[date])
var _min =maxx(date,date[date])
var datediff1 = datediff(_min,_max,day)
var _maxX = _max-datediff1
var _minX = _min -datediff1
return
CALCULATE(SUM(Sales[Sales Amount]),filter(all(date,date[date]<=_maxX &&date[date]>=_minX)))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |