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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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