March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
hii
I want to find last 12 month sum from selected month if i am in Dec -17 then last 12 month person count (count of personnel number) again same for nov-17 is selected then that month and last 12 month count of personnel number count sum like wise .......
Solved! Go to Solution.
For this to work, you need a SERIAL ID column for the months in your calendar table.
A serial ID will start at 1, but will increase by 1 for each month, and NOT reset after 12.
For example, if your calendar starts in January 2016, then that month ID = 1. January 2017's month ID = 13.
Assuming that column exists in your calendar table, (and the column is called [MonthID]), this is the formula:
Measure = CALCULATE ( SUM ( TableName[ColumnName] ), FILTER ( ALL ( Calendar ), Calendar[MonthID] <= MAX ( Calendar[MonthID] ) && Calendar[MonthID] >= MAX ( Calendar[MonthID] ) - 11 ) )
For this to work, you need a SERIAL ID column for the months in your calendar table.
A serial ID will start at 1, but will increase by 1 for each month, and NOT reset after 12.
For example, if your calendar starts in January 2016, then that month ID = 1. January 2017's month ID = 13.
Assuming that column exists in your calendar table, (and the column is called [MonthID]), this is the formula:
Measure = CALCULATE ( SUM ( TableName[ColumnName] ), FILTER ( ALL ( Calendar ), Calendar[MonthID] <= MAX ( Calendar[MonthID] ) && Calendar[MonthID] >= MAX ( Calendar[MonthID] ) - 11 ) )
@Anonymous thank you this works very well....
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
167 | |
117 | |
63 | |
57 | |
50 |