cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper II

## Average 4 week same week day

Hi everyone,
I want to produce a function that will make me an average of the number of users each month of all days of the week (Sunday until Saturday)
For example:
The average of Sundays in July is X
The average of Mondays in July is y
The average of Tuesdays in July is Z

Thanks!

1 ACCEPTED SOLUTION
Super User

@dolevh So, have to make some assumptions because no sample source data, but perhaps something like:

``````Measure =
VAR __Date = MAX('Table'[Date)
VAR __Weekday = WEEKDAY(__Date)
VAR __Month = MONTH(__Date)
VAR __Year = YEAR(__Date)
VAR __Table = FILTER(ALL('Table'),[Year]=__Year && [Month]=__Month && [Weekday]=__Weekday)
RETURN
DIVIDE(
SUMX(__Table,[Value]),
COUNTROWS(__Table),
0
)``````

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Super User

@dolevh So, have to make some assumptions because no sample source data, but perhaps something like:

``````Measure =
VAR __Date = MAX('Table'[Date)
VAR __Weekday = WEEKDAY(__Date)
VAR __Month = MONTH(__Date)
VAR __Year = YEAR(__Date)
VAR __Table = FILTER(ALL('Table'),[Year]=__Year && [Month]=__Month && [Weekday]=__Weekday)
RETURN
DIVIDE(
SUMX(__Table,[Value]),
COUNTROWS(__Table),
0
)``````

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

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

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors