The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
In this table ('Random prices'), I use the 'Previous month' measure and I would like to get the price from Jan 3, which is blank. It gives me the price from Jan 5, but I want to give me the price from Jan 2.
The measures I use are:
Solved! Go to Solution.
Hi,
I am not sure how your datamodel looks like, but please try something like below.
Previous month =
VAR _latestdate =
MAX ( 'Random prices'[Date] )
VAR _prevmonthlatestdate =
MAXX (
FILTER (
'Random prices',
'Random prices'[Date] <= EOMONTH ( _latestdate, -1 )
&& DAY ( 'Random prices'[Date] ) <= DAY ( _latestdate )
),
'Random prices'[Date]
)
RETURN
CALCULATE ( [Latest price], 'Random prices'[Date] = _prevmonthlatestdate )
Hi,
I am not sure how your datamodel looks like, but please try something like below.
Previous month =
VAR _latestdate =
MAX ( 'Random prices'[Date] )
VAR _prevmonthlatestdate =
MAXX (
FILTER (
'Random prices',
'Random prices'[Date] <= EOMONTH ( _latestdate, -1 )
&& DAY ( 'Random prices'[Date] ) <= DAY ( _latestdate )
),
'Random prices'[Date]
)
RETURN
CALCULATE ( [Latest price], 'Random prices'[Date] = _prevmonthlatestdate )