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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Krishna090
Regular Visitor

how to achieve avg of the columns

 Hi.

I have calculated measure  from column E to J and A to D are the values from DB
(attached screenshot for quick view
and I required row no 14 to 17 ( Avg of 7D,30D,60D and MTD) 
typo error --> its 60D and not 90D in the screenshot
)query.JPG

1 ACCEPTED SOLUTION
mickey64
Super User
Super User

For your reference.

 

Step 1: I make a calendar table.

    mickey64_0-1697710953008.png

Step 2: I add a relationship.

    mickey64_1-1697711003934.png

Step 3: I make these measures for the 'Start' column.

    Last 7D AVG_Start = CALCULATE(AVERAGE('DATA'[Start]),DATESBETWEEN('Calendar'[Date],TODAY()-6,TODAY()))

    Last 30D AVG_Start = CALCULATE(AVERAGE('DATA'[Start]),DATESBETWEEN('Calendar'[Date],TODAY()-29,TODAY()))

    Last 60D AVG_Start = CALCULATE(AVERAGE('DATA'[Start]),DATESBETWEEN('Calendar'[Date],TODAY()-59,TODAY()))

    MTD AVG_Start = CALCULATE(AVERAGE('DATA'[Start]),DATESBETWEEN('Calendar'[Date],DATE(YEAR(TODAY()),MONTH(TODAY()),1),TODAY()))

 

Step 4: I make other measures for other columns.

View solution in original post

1 REPLY 1
mickey64
Super User
Super User

For your reference.

 

Step 1: I make a calendar table.

    mickey64_0-1697710953008.png

Step 2: I add a relationship.

    mickey64_1-1697711003934.png

Step 3: I make these measures for the 'Start' column.

    Last 7D AVG_Start = CALCULATE(AVERAGE('DATA'[Start]),DATESBETWEEN('Calendar'[Date],TODAY()-6,TODAY()))

    Last 30D AVG_Start = CALCULATE(AVERAGE('DATA'[Start]),DATESBETWEEN('Calendar'[Date],TODAY()-29,TODAY()))

    Last 60D AVG_Start = CALCULATE(AVERAGE('DATA'[Start]),DATESBETWEEN('Calendar'[Date],TODAY()-59,TODAY()))

    MTD AVG_Start = CALCULATE(AVERAGE('DATA'[Start]),DATESBETWEEN('Calendar'[Date],DATE(YEAR(TODAY()),MONTH(TODAY()),1),TODAY()))

 

Step 4: I make other measures for other columns.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.