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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
kbbsl
Frequent Visitor

Apply FILTER to IF in measure

Hi All,

 

I have the following measure on a power bi visual but would like to apply a filter to it in the measure (rather than on visual) so that it includes months year to date starting with June 2025 (i.e. will only show June and July so far for 2025). Please could someone assist?

 

Total percentage =
IF(
SELECTEDVALUE(Total[Month])="Total",
CALCULATE('Briefing List'[Total percentage part 1], VALUE(FILTER(Total,Total[Month]<=MAX('Date'[Date])))),
'Briefing List'[Total percentage part 1])
 
Total = table of months with Total added to it so that it is displayed on graph
 
Total percentage part 1 = CALCULATE('Briefing List'[Completion step 1] / 'Briefing List'[Monthly count percentage] )*100
 
Completion step 1 = SUMX (
    VALUES ( 'Date'[Month]),
    CALCULATE ( DISTINCTCOUNT ( 'Safety Conv'[Employee Name Final] ) )
)
 
Monthly count percentage =
SUMX(CALCULATETABLE(VALUES('Briefing List'[Created]),ALL('Date')),
var _Endofdaterange = MAX('Date'[Date])
var _Startdate = MIN('Date'[Date])
var _numberofmonths = DATEDIFF(_Startdate,_Endofdaterange,MONTH)+1
var _Amount = CALCULATE(SUM('Briefing List'[Created]),ALL('Date'))
RETURN
(_numberofmonths*[Monthly count]))

 

Thanks

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@kbbsl , Try using

 

DAX
Total percentage =
IF(
SELECTEDVALUE(Total[Month]) = "Total",
CALCULATE(
'Briefing List'[Total percentage part 1],
FILTER(
ALL('Date'),
'Date'[Date] >= DATE(2025, 6, 1) && 'Date'[Date] <= TODAY()
)
),
'Briefing List'[Total percentage part 1]
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

2 REPLIES 2
kbbsl
Frequent Visitor

@bhanu_gautam Thanks for the prompt response, this works a treat.

bhanu_gautam
Super User
Super User

@kbbsl , Try using

 

DAX
Total percentage =
IF(
SELECTEDVALUE(Total[Month]) = "Total",
CALCULATE(
'Briefing List'[Total percentage part 1],
FILTER(
ALL('Date'),
'Date'[Date] >= DATE(2025, 6, 1) && 'Date'[Date] <= TODAY()
)
),
'Briefing List'[Total percentage part 1]
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.