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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
s2anya
Frequent Visitor

Average of 12 Months column

Following is the data sample we are dealing with , which is having 27 months data. From which we need to extract 12 months data and show it as defined in the output dataset. 

For now we are using matrix and have pivoted the data on date column, but we are not able to add the average column as per our requirement.

 

Data Sample-

       
DateKPI-1KPI-2KPI-3KPI-4KPI-5KPI-6
Saturday, October 01, 2016691585501654565586
Tuesday, November 01, 2016575516636562648513
Thursday, December 01, 2016596615608634537521
Sunday, January 01, 2017512600699698572589
Wednesday, February 01, 2017534520691538614551
Wednesday, March 01, 2017520531663551561540
Saturday, April 01, 2017636683627524509514
Monday, May 01, 2017665542542527571582
Thursday, June 01, 2017639517679632559631
Saturday, July 01, 2017675665528680653625
Tuesday, August 01, 2017564690584602684521
Friday, September 01, 2017547596552632566527
Thursday, October 01, 2015537641603680528687
Tuesday, November 01, 2016594631694518644628
Monday, December 01, 2014699527699504502520
Saturday, February 01, 2014561537638651526609
Tuesday, March 01, 2016686589582647620570
Friday, May 01, 2015603578660519662653

 

 

Output-

MetricOct-16Nov-16Dec-16Jan-17Feb-17Mar-17Apr-17May-17Jun-17Jul-17Aug-17Sep-1712 Month Avg
KPI-1691575596512534520636665639675564547594.4166667
KPI-258551661560052053168354251766569059610367.33333
KPI-3501636608699691663627542679528584552186.75
calculated KPI-4654562634698538551524527632680602632594.4166667
calculated KPI-5565648537572614561509571559653684566781.1666667
calculated KPI-695.5%94.2%94.1%96.6%94.6%96.6%95.1%94.8%94.7%95.1%95.8%96.1%95.3%
1 ACCEPTED SOLUTION
Eric_Zhang
Employee
Employee

@s2anya

One way for your reference.

1.Unpivot the KPI columns.

unpivot2.gif

 

2.Create a matrix with below measure, setting page level filter "is on or after" 2016-11-01.

Measure =
IF (
    HASONEVALUE ( yourTable[KPI] ) && HASONEVALUE ( yourTable[Date] ),
    SUM ( yourTable[Value] ),
    AVERAGE ( yourTable[Value] )
)

Capture.PNG

View solution in original post

2 REPLIES 2
Eric_Zhang
Employee
Employee

@s2anya

One way for your reference.

1.Unpivot the KPI columns.

unpivot2.gif

 

2.Create a matrix with below measure, setting page level filter "is on or after" 2016-11-01.

Measure =
IF (
    HASONEVALUE ( yourTable[KPI] ) && HASONEVALUE ( yourTable[Date] ),
    SUM ( yourTable[Value] ),
    AVERAGE ( yourTable[Value] )
)

Capture.PNG

it worked, Thankyou so much 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.