Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello fantastic community,
I have a table like this:
Date | Biomass |
31/12/2023 | 10 |
31/01/2024 | 12 |
29/02/2024 | 14 |
As I only have one column of dates, I consider that the biomass at the end of the month is equal to the biomass on the first day of the following month.
Now I have one measure named Initial Biomass:
Initial Biomass =
VAR _day = MIN( 'Date'[Date] )
VAR _previous_day = _day - 1
Var _month_previous_day = MONTH( _previous_day )
Var _year_previous_day = YEAR( _previous_day )
VAR _ini_bio_SE_1=
CALCULATE(
SUM( 'Movimentos SE'[Biomass (kg)] ),
FILTER(
ALL( 'Date'),
'Date'[Month Number] = _month_previous_day &&
'Date'[Year] = _year_previous_day
)
)
And this is working fine, but now I only want to have the average of visible months, when no month is selected for example:
Nov 23 | Dec 23 | Jan 24 | Feb 24 | Mar 24 | Total | |
Initial Biomass | 15 | 18 | 10 | 12 | 14 | 13.8 |
The total should change depending on the visible months.
Any help would be highly appreciated!
Thank you,
Simao
You cannot measure a measure directly. Either materialize it first, or create a separate measure that implements the entire business logic.
User | Count |
---|---|
98 | |
90 | |
82 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
66 |