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
vaibhavd
Frequent Visitor

In metrics visual, how to make subtotal as dynamic average based on drill down date ?

When the column header is selected as Month, provide average by month and user drill up to have quarter, the provide average by quarter.

 

Currently with following measure, I could see average by month but when I drill-up, average value should be the average of values displayed in columns.

 

My Maesure: 

Index =
VAR FactorTableByCustomer = SUMMARIZE(CUSTOMERS, CUSTOMERS[CUSTOMER_CD], "FactorCustomer", [Index ReportedIssue])
VAR FactorTableByMonth = SUMMARIZE(Dates, Dates[MonthInCalendar], "FactorMonth", [Index ReportedIssue])
VAR FactorTableByDay = SUMMARIZE(Dates, Dates[DayInCalendar], "FactorDay", [Index ReportedIssue])

RETURN
     IF(HASONEFILTER(Dates[DayInCalendar]),
           AVERAGEX(FactorTableByCustomer, [FactorCustomer]),
               IF(HASONEFILTER(Dates[MonthInCalendar]),
                  AVERAGEX(FactorTableByCustomer, [FactorCustomer]),
                       IF(HASONEFILTER(CUSTOMERS[CustomerBranch]),
                          AVERAGEX(FactorTableByMonth, [FactorMonth])
                      )
                 )
        )

 

CustomerBranchJul-19Aug-19Sep-19Oct-19Nov-19Dev-19Jan-20Average
A252500199020.14
B53731342010031.14
C2073220703010045
Average16.72626.71124.72396.7 

 

CustomerBranchQ3-19Q4-19Q1-20AverageExpected Avg
A10.76.39020.1435.7
B2712.310031.1446.4
C31.7401004557.23
Average23.119.596.7  

 

Please suggest - how can I achive this.

 

Thanks,

Vaibhav

1 REPLY 1
HI_IM_THIBBY
Helper I
Helper I

Hello,

 

Will need more information on this to try helping out – what are examples of values you'd get from [Index ReportedIssue], [FactmorMonth] and [FactorCustomer]?

Also, it might be helpful to check out these articles about using SUMMARIZE() functions, could be possible that you're losing context because of how you have them currently structured.

https://www.sqlbi.com/articles/best-practices-using-summarize-and-addcolumns/

https://powerpivotpro.com/2017/12/summarize-addcolumns-arent-scary-can-see/

 

 Also also, instead of using HASONEFILTER(), maybe try using ISFILTERED() to see if that yields different results?

https://docs.microsoft.com/en-us/dax/isfiltered-function-dax

Shots in the dark but hopefully these will be helpful.

Thanks,
HI_IM_THIBBY

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.

Top Solution Authors