Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hello,
I have a huge table with a lot of information but only some columns are related to this topic. And so it begins:
every month I have a new "x" data. This X is calculated like this :
Solved! Go to Solution.
Hi @Alexa1104
If you have a Date Table in your data model, you can try below. Replace the [ThisTable'sDateColumn] part with the actual date column from the table. [x] is the count measure. Provide a sample of the table with columns ames and maybe I can taylor the emasure better for you
Joe
Rolling 3 Month Average =
VAR NumOfMonths = 3
VAR LastCurrentDate =
MAX ( DIM_Date[Date] )
VAR Period =
DATESINPERIOD ( DIM_Date[Date] , LastCurrentDate, - NumOfMonths, MONTH )
VAR Result =
CALCULATE (
AVERAGEX (
VALUES ( DIM_Date[Date] ),
[X]
),
Period
)
VAR FirstDateInPeriod = MINX ( Period, DIM_Date[Date] )
VAR LastDateWithViews = MAX ( 'ReqTestResults'[ThisTable'sdateColumn] )
RETURN
IF ( FirstDateInPeriod <= LastDateWithViews, Result )
Proud to be a Super User! | |
Date tables help! Learn more
Thank you very much! you solution worked perfectly!
Hi @Alexa1104
If you have a Date Table in your data model, you can try below. Replace the [ThisTable'sDateColumn] part with the actual date column from the table. [x] is the count measure. Provide a sample of the table with columns ames and maybe I can taylor the emasure better for you
Joe
Rolling 3 Month Average =
VAR NumOfMonths = 3
VAR LastCurrentDate =
MAX ( DIM_Date[Date] )
VAR Period =
DATESINPERIOD ( DIM_Date[Date] , LastCurrentDate, - NumOfMonths, MONTH )
VAR Result =
CALCULATE (
AVERAGEX (
VALUES ( DIM_Date[Date] ),
[X]
),
Period
)
VAR FirstDateInPeriod = MINX ( Period, DIM_Date[Date] )
VAR LastDateWithViews = MAX ( 'ReqTestResults'[ThisTable'sdateColumn] )
RETURN
IF ( FirstDateInPeriod <= LastDateWithViews, Result )
Proud to be a Super User! | |
Date tables help! Learn more
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
14 | |
10 | |
9 | |
9 |
User | Count |
---|---|
15 | |
12 | |
12 | |
11 | |
11 |