Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
I'm currently creating a matrix within a Power BI dashboard which looks similar to the following layout (apologies cannot share the real dataset for confidentiality reasons):
| Date | Resource Identifier | Hourly Cost | Annualised Cost |
| 19/04/2022 | A1 | 0.15 | $3.91 |
| A2 | 0.20 | $5.21 | |
| A3 | 0.26 | $6.78 | |
| 20/04/2022 | B6 | 0.10 | $2.61 |
| B7 | 0.12 | $3.13 | |
| B20 | 0.88 | $22.94 |
The annualised cost is the calculated field here and the logic required is:
Annualised Cost = Hourly Cost / Number of Selected Days x 365
The number of selected days should be derived from the number of days selected within the page level filter and as such, if the user changes the number of selected days, the annualised cost shoudl also change. Is there a way to do this within a matrix? I've been playing around with it and it always sets the number of selected days as 1.
Thanks in advance for your help!
Hi,
Assuming the user select a beginning and ending date in the Page filter, the number of selected days can be derived by this measure:
Selected days = max(calendar[date])-min(calendar[date])+1
Hope this helps.
Hi Ashish,
Thanks for your response.
Normally, I can work out the number of selected days (it's a selection of individual days) with a DISTINCTCOUNT on the date field. However, as this is in a matrix, using DISTINCTCOUNT always shows up as count of 1.
Can you think of a way to tackle this problem?
Hi, @Anonymous
Not fully sure what you want.
Can you share a sample pbix file for further research?
Best Regards,
Community Support Team _ Eason
I cannot understand your question.