Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have a running total over all the year, but i also need a running total that starts counting every year.
Now as you can see in the picture it starts in 2012 but then continues in 2013 with the data from dec 2012. I need another measure that starts from january every year.
My code so far is:
Cumulative Sales (over years)=
IF (
COUNTROWS ( Fact_Transactielijnen ) > 0;
CALCULATE(
[Bedrag];
FILTER(
ALL (Dim_Date[Date]);
Dim_Date[Date] <= MAX ((Dim_Date[Date]))
)
);
BLANK ()
)
Thanks in advance
Solved! Go to Solution.
Hi @jvangrunderbeec,
You can add condition to check current year to break cumulative calculate across different years:
Cumulative Sales (over years) = VAR CurrDate = MAX ( Dim_Date[Date] ) RETURN IF ( COUNTROWS ( Fact_Transactielijnen ) > 0; CALCULATE ( [Bedrag]; FILTER ( ALLSELECTED ( Dim_Date ); Dim_Date[Date] <= CurrDate && YEAR ( Dim_Date[Date] ) = YEAR ( CurrDate ) ) ); BLANK () )
Regards,
Xiaoxin Sheng
Hi @jvangrunderbeec,
You can add condition to check current year to break cumulative calculate across different years:
Cumulative Sales (over years) = VAR CurrDate = MAX ( Dim_Date[Date] ) RETURN IF ( COUNTROWS ( Fact_Transactielijnen ) > 0; CALCULATE ( [Bedrag]; FILTER ( ALLSELECTED ( Dim_Date ); Dim_Date[Date] <= CurrDate && YEAR ( Dim_Date[Date] ) = YEAR ( CurrDate ) ) ); BLANK () )
Regards,
Xiaoxin Sheng
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
118 | |
101 | |
71 | |
61 |