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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Krishna090
New Member

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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