Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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]))
Solved! Go to Solution.
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:
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.
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":
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.
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":
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.
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:
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?
it did not work 😞
tried both REMOVEFILTERS() and REMOVEFILTERS(ProjectID)
CALCULATE(FinalResult,REMOVEFILTERS(Toggl[ProjectID]))
try removefilter() in the return
User | Count |
---|---|
141 | |
113 | |
104 | |
78 | |
64 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |