The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
I have the following measure:
Solved! Go to Solution.
Hi @Anonymous ,
According to your description, you want to calculate the value of the current date minus the value of the current date at the end of the month of the previous month. Here are my steps you can follow as a solution.
(1)This is my test data.
(2)We can create a measure.
Measure = var _slice= SELECTEDVALUE('V3 Measure for Changes'[Date])
var _cuurent_gbp =SUMX( FILTER( ALL('V3 Measure for Changes'), 'V3 Measure for Changes'[Date] =_slice) , [EOD Balance in GBP])
var _last_month = EOMONTH( _slice , -1)
var _last_gbp =SUMX( FILTER( ALL('V3 Measure for Changes'), 'V3 Measure for Changes'[Date] =_last_month) , [EOD Balance in GBP])
return
_cuurent_gbp-_last_gbp
(3)Then the result is as follows.
If this method does not meet your needs, you can provide us with detailed input and output examples in tabular form so that we can better solve the problem for you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
According to your description, you want to calculate the value of the current date minus the value of the current date at the end of the month of the previous month. Here are my steps you can follow as a solution.
(1)This is my test data.
(2)We can create a measure.
Measure = var _slice= SELECTEDVALUE('V3 Measure for Changes'[Date])
var _cuurent_gbp =SUMX( FILTER( ALL('V3 Measure for Changes'), 'V3 Measure for Changes'[Date] =_slice) , [EOD Balance in GBP])
var _last_month = EOMONTH( _slice , -1)
var _last_gbp =SUMX( FILTER( ALL('V3 Measure for Changes'), 'V3 Measure for Changes'[Date] =_last_month) , [EOD Balance in GBP])
return
_cuurent_gbp-_last_gbp
(3)Then the result is as follows.
If this method does not meet your needs, you can provide us with detailed input and output examples in tabular form so that we can better solve the problem for you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , Last day of last month
Last Month =
var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _max = eomonth(_max1,-1)
var _min = eomonth(_max1,-2)+1
return
CALCULATE([your measure] ,DATESBETWEEN('Date'[Date],_max,_max))
or last non blank
Last Month =
var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _max = eomonth(_max1,-1)
var _min = eomonth(_max1,-2)+1
return
CALCULATE(lastnonblankvalues( 'Date'[Date] , [Your measure]) ,DATESBETWEEN('Date'[Date],_min,_max))
https://medium.com/chandakamit/power-bi-when-i-felt-lazy-and-i-needed-too-many-measures-ed8de20d9f79
User | Count |
---|---|
17 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |