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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Anonymous
Not applicable

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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