Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi, @Anonymous
You can try to create calculated columns as follows
Pre_Sche Chh Booked Hrs =
VAR Pre_date =
CALCULATE (
MAX ( 'dim Date'[Date] ),
'dim Date',
'dim Date'[Date] < EARLIER ( 'dim Date'[Date] )
)
RETURN
CALCULATE (
SUM ( 'dim Date'[Sche Chh Booked Hrs] ),
'dim Date',
'dim Date'[Date] = Pre_date
)
diff =
IF (
ISBLANK ( 'dim Date'[Pre_Sche Chh Booked Hrs] ),
BLANK (),
'dim Date'[Sche Chh Booked Hrs] - 'dim Date'[Pre_Sche Chh Booked Hrs]
)
Growth % =
IF (
ISBLANK ( 'dim Date'[diff] ),
BLANK (),
'dim Date'[diff] / 'dim Date'[Pre_Sche Chh Booked Hrs]
)
The result will show as below:
Please check my sample file for more details.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
You can try to create calculated columns as follows
Pre_Sche Chh Booked Hrs =
VAR Pre_date =
CALCULATE (
MAX ( 'dim Date'[Date] ),
'dim Date',
'dim Date'[Date] < EARLIER ( 'dim Date'[Date] )
)
RETURN
CALCULATE (
SUM ( 'dim Date'[Sche Chh Booked Hrs] ),
'dim Date',
'dim Date'[Date] = Pre_date
)
diff =
IF (
ISBLANK ( 'dim Date'[Pre_Sche Chh Booked Hrs] ),
BLANK (),
'dim Date'[Sche Chh Booked Hrs] - 'dim Date'[Pre_Sche Chh Booked Hrs]
)
Growth % =
IF (
ISBLANK ( 'dim Date'[diff] ),
BLANK (),
'dim Date'[diff] / 'dim Date'[Pre_Sche Chh Booked Hrs]
)
The result will show as below:
Please check my sample file for more details.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous This can be done if you add another column to your table for YearPeriod - it should be unique so will look something like:
2020-03-1 for March period 1
2020-04-2 for April period 2
Then you can create a DAX Measure and use a variable to get the previous period.
It will be similar to the below:
PrevPeriod Hours =
VAR _MaxPeriod = MAX(DimDate[YearPeriod])
VAR _prevPeriod = MAXX(FILTER(DimDate, DimDate[YearPeriod] <_MaxPeriod), DimDate[YearPeriod])
RETURN
CALCULATE([hours], DimDate[YearPeriod] = _prevPeriod)
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
We ended up created our previous measures and incorporated the previous period in our data model, which helped immensely.
User | Count |
---|---|
124 | |
108 | |
99 | |
62 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |