Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
simaotc
Frequent Visitor

Average of Measures

Hello fantastic community,

I have a table like this:

DateBiomass
31/12/202310
31/01/202412
29/02/202414


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 23Dec 23Jan 24Feb 24Mar 24Total
Initial Biomass151810121413.8

 

The total should change depending on the visible months.

 

Any help would be highly appreciated!

 

Thank you,

Simao

1 REPLY 1
lbendlin
Super User
Super User

You cannot measure a measure directly. Either materialize it first, or create a separate measure that implements the entire business logic.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.