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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
jagostinhoCT
Post Partisan
Post Partisan

Cannot override Page Filter in Measure

Hello,

 

I have a ProjectID Page Filter applied so that all measures and graphs only report from ProjectID = 018CAD.

There is only one measure I would like to measure the Total Hours across all the ProjectID values.

I am using the CALCULATE function along with the ALL for the Filter but for some reason it seems that it is not working.

 

Can you help me to understand where is the error in my measure, please?

Thank you

 

Duration Total Hours Auditing Time AsString = 
// Overrides all Page Filters
VAR TotalHours = (SUM(Toggl[DurationTotalMinutes])/60)
VAR TotalMinutes = (SUM(Toggl[DurationTotalMinutes]))
VAR FinalResult = if(ISBLANK(TotalHours),"0",if(TotalHours<0,(TotalMinutes & " m"),Round(TotalHours,0)) & " h")
Return
CALCULATE(FinalResult,ALL(Toggl[ProjectID]))

jagostinhoCT_0-1648143926654.png

jagostinhoCT_1-1648143937355.png

 

2 ACCEPTED SOLUTIONS
v-eqin-msft
Community Support
Community Support

Hi @jagostinhoCT ,

 

I have a test on my side, please modify your measure:

Duration Total Hours Auditing Time AsString = 

//override page filter at first
VAR TotalMinutes = CALCULATE( SUM(Toggl[DurationTotalMinutes]),ALL(Toggl))

VAR TotalHours =TotalMinutes/60
return  if(ISBLANK(TotalHours),"0",if(TotalHours<0,(TotalMinutes & " m"),Round(TotalHours,0)) & " h")

Output:

Recording 2022-03-29 at 13.31.42.gif


Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

v-eqin-msft
Community Support
Community Support

Hi @jagostinhoCT ,

 

To my knowledge, It's not possible to override page-filter but keep filter in slicer since the filters has priority.

My workaround is to create a slicer for ProjectID instead of apply it to page-filter. And then select the interaction type as "None":

Recording 2022-03-30 at 17.40.02.gif

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-eqin-msft
Community Support
Community Support

Hi @jagostinhoCT ,

 

To my knowledge, It's not possible to override page-filter but keep filter in slicer since the filters has priority.

My workaround is to create a slicer for ProjectID instead of apply it to page-filter. And then select the interaction type as "None":

Recording 2022-03-30 at 17.40.02.gif

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-eqin-msft
Community Support
Community Support

Hi @jagostinhoCT ,

 

I have a test on my side, please modify your measure:

Duration Total Hours Auditing Time AsString = 

//override page filter at first
VAR TotalMinutes = CALCULATE( SUM(Toggl[DurationTotalMinutes]),ALL(Toggl))

VAR TotalHours =TotalMinutes/60
return  if(ISBLANK(TotalHours),"0",if(TotalHours<0,(TotalMinutes & " m"),Round(TotalHours,0)) & " h")

Output:

Recording 2022-03-29 at 13.31.42.gif


Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This worked beatifully, @v-eqin-msft . Thank you.

I think I understand what you did. You remove the filter on the first calculation rather than on the Return expression. Learned something new today, thank you.

 

I only realised now that my question was not exactly what I needed as I would still like to keep that measure to react to the date slicer. Would this be an easy tweak to the code, you reckon?

jagostinhoCT_0-1648630720046.png

 

jagostinhoCT
Post Partisan
Post Partisan

it did not work 😞

tried both REMOVEFILTERS() and REMOVEFILTERS(ProjectID)

 

CALCULATE(FinalResult,REMOVEFILTERS(Toggl[ProjectID]))

 

mh2587
Solution Sage
Solution Sage

try removefilter() in the return



Muhammad Hasnain

#LetsConnect https://www.linkedin.com/in/hasnain2587/

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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