Join 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!View all the Fabric Data Days sessions on demand. View schedule
Hello,
I have two tables, one fact_table that contains the application_id and created_on (which is the date when the application was created) and one date_table(dimdate). I want to calculate the average of applications for the selected period.
Avg = (nr of applications)/ (nr of days)
If I select period from March-July , I want the nr of days to be 62 for only the two months that have applications.
| application_id | created_on |
| id1 | 05.03.2021 |
| id2 | 01.07.2021 |
| id3 | 10.07.2021 |
| id4 | 12.07.2021 |
| id5 | 20.07.2021 |
Solved! Go to Solution.
Thank you so much
I added the column Month-Year from the Created_on date and than used it.
Very easy one,
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Thank you so much
I added the column Month-Year from the Created_on date and than used it.
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
The slicer in my sample functions as,
- even the startdate / enddate is in the middle of a certain month, it calculates from the beginning date of the month until the end date of the month.
Average measure: =
VAR selectedyears =
VALUES ( Dates[Year] )
VAR selectedmonths =
VALUES ( Dates[Month] )
VAR selectedperiod_in_date =
SUMMARIZE (
FILTER (
ALL ( Dates ),
Dates[Year]
IN selectedyears
&& Dates[Month] IN selectedmonths
),
Dates[Date]
)
VAR numberofapplications =
CALCULATE ( COUNTROWS ( 'Fact' ), 'Fact'[created_on] IN selectedperiod_in_date )
VAR selectedapplication_in_year =
SUMMARIZE (
ADDCOLUMNS (
CALCULATETABLE (
VALUES ( 'Fact'[created_on] ),
'Fact'[created_on] IN selectedperiod_in_date
),
"@year", YEAR ( 'Fact'[created_on] )
),
[@year]
)
VAR selectedapplication_in_month =
SUMMARIZE (
ADDCOLUMNS (
CALCULATETABLE (
VALUES ( 'Fact'[created_on] ),
'Fact'[created_on] IN selectedperiod_in_date
),
"@month", MONTH ( 'Fact'[created_on] )
),
[@month]
)
VAR countdays =
CALCULATE (
COUNTROWS ( Dates ),
FILTER (
ALL ( Dates ),
Dates[Year]
IN selectedapplication_in_year
&& Dates[Month] IN selectedapplication_in_month
)
)
RETURN
numberofapplications / countdays
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!