Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hey there!
I have a cumulative measure written as such:
Cumulative measure =
VAR firstvisibledate =
MIN ( fact_Economic_Details[Production_Date] )
VAR lastvisibledate =
MAX ( fact_Economic_Details[Production_Date] )
VAR lastproddate =
CALCULATE (
MAX ( fact_Economic_Details[Production_Date] ),
REMOVEFILTERS ()
)
VAR result =
IF (
firstvisibledate <= lastproddate,
CALCULATE (
[Gross Production Volume], --this is a basic sum calculation
'dim_Date'[Date] <= lastvisibledate
)
)
RETURN
result
I want to get the value of this measure at the 12 month mark. Any idea how to implement this?
@Syk So 12 months in the past or for the last 12 months only? Maybe something like this?
Last 12 Months =
VAR __Today = TODAY()
VAR __12MonthsAgo = EOMONTH( __Today, -12)
VAR __MinDate = DATE(YEAR(__12MonthsAgo), MONTH(__12Months), 1)
VAR __Table = SUMMARIZE( 'fact_Economic_Details',[Production_Date], "__Value", [Cumulative measure])
VAR __Result = SUMX(__Table, [__Value])
RETURN
__Result
The cumulative measure that I have starts at the first month of production (for a given entity). I need the first 12 months of production. The date ranges will be different for each entity as they start producing at different dates.
User | Count |
---|---|
57 | |
21 | |
18 | |
16 | |
16 |
User | Count |
---|---|
87 | |
77 | |
52 | |
37 | |
21 |