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.
have years of data for telecom charges with an accounting date.
The Month to Month quick measure is almost what I want, but not quite. I have modified it below to return the $ value instead of the percentage. The problem is the Previous month is always -1 and I either need it to be fixed on the base month. or increment, like -1 then -2 then -3 etc.
For example if I choose all of 2021 I want the previous month calculation to always be January while the current month cycles through all of the months.
Also the range will be user selected so the first month could be any month and the duration could be any length.
Any ideas?
Solved! Go to Solution.
@daviddavidson , Try measure like
First Month of Year =
var _max1 = eomonth(if(isfiltered('Date'),MAX( 'Date'[Date]) , today()),0)
var _min = eomonth(_max,-1*month(_max1) )+1
var _max = eomonth(_min,0)
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
This Month =
var _max = eomonth(if(isfiltered('Date'),MAX( 'Date'[Date]) , today()),0)
var _min = eomonth(_max,-1)+1 ,
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
LMTD =
var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _max = date(Year(_max1), month(_max1)-1, day(_max))
var _min = eomonth(_max1,-2)+1
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
Last Month =
var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _max = eomonth(_max1,-1)
var _min = eomonth(_max1,-2)+1
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
https://medium.com/chandakamit/power-bi-when-i-felt-lazy-and-i-needed-too-many-measures-ed8de20d9f79
Hi, @daviddavidson ;
Try it.
Measure =
var _min= CALCULATE(MIN('Telecom wireline all years'[Accounting Period]),ALLSELECTED('Telecom wireline all years'))
return
SUM([Distribution Amount])-
CALCULATE(SUM('Telecom wireline all years'[Distribution Amount]),FILTER(ALL('Telecom wireline all years'),EOMONTH([Accounting Period],0)=EOMONTH(_min,0)))
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @daviddavidson ;
Try it.
Measure =
var _min= CALCULATE(MIN('Telecom wireline all years'[Accounting Period]),ALLSELECTED('Telecom wireline all years'))
return
SUM([Distribution Amount])-
CALCULATE(SUM('Telecom wireline all years'[Distribution Amount]),FILTER(ALL('Telecom wireline all years'),EOMONTH([Accounting Period],0)=EOMONTH(_min,0)))
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Yalan Wu,
Thanks this did most of what I needed. I used ALLEXCEPT instead of ALL to keep some of the filters. I appreciate the help.
@daviddavidson , Try measure like
First Month of Year =
var _max1 = eomonth(if(isfiltered('Date'),MAX( 'Date'[Date]) , today()),0)
var _min = eomonth(_max,-1*month(_max1) )+1
var _max = eomonth(_min,0)
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
This Month =
var _max = eomonth(if(isfiltered('Date'),MAX( 'Date'[Date]) , today()),0)
var _min = eomonth(_max,-1)+1 ,
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
LMTD =
var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _max = date(Year(_max1), month(_max1)-1, day(_max))
var _min = eomonth(_max1,-2)+1
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
Last Month =
var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _max = eomonth(_max1,-1)
var _min = eomonth(_max1,-2)+1
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
https://medium.com/chandakamit/power-bi-when-i-felt-lazy-and-i-needed-too-many-measures-ed8de20d9f79
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 |
---|---|
114 | |
105 | |
78 | |
68 | |
63 |
User | Count |
---|---|
148 | |
107 | |
106 | |
84 | |
70 |