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!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hi Everyone,
Working with a Matrix table and almost have all my issues resolved. This code (to create a measure with value = 00:00:00 (hh:mm:ss)) is working great.
However, it's ignoring the in-place filter from the MS visual slicer. I have 'both' turned on in the relationship...
How do I wrap this puppy (code below) in a KEEPFilter command?
ACD Time (min) = VAR TotalSeconds=SUMX('agent_interval',HOUR('agent_interval'[acdTime_i_HHMMSS])*3600+MINUTE('agent_interval'[acdTime_i_HHMMSS])*60+SECOND('agent_interval'[acdTime_i_HHMMSS]))
VAR Days =TRUNC(TotalSeconds/3600/24)
VAR Hors = TRUNC((TotalSeconds-Days*3600*24)/3600)
VAR Mins =TRUNC(MOD(TotalSeconds,3600)/60)
VAR Secs = MOD(TotalSeconds,60)
return IF(DAYS=0,"",IF(DAYS>1,DAYS&"days ",Days&"day"))&IF(Hors=0,"0"&Hors,Hors)&":"&IF(Mins=0,"0"&Mins,Mins)&":"&IF(Secs=0,"0"&Secs,Secs)Thanks,
Chas
Solved! Go to Solution.
Hi @Chas2002
Do you mean, you want to make sure filters set external to the matrix are applied to the calculation?
If so, try this....
ACD Time (min) = VAR TotalSeconds=SUMX(ALLSELECTED('agent_interval') ,HOUR('agent_interval'[acdTime_i_HHMMSS])
Hi @Chas2002
Do you mean, you want to make sure filters set external to the matrix are applied to the calculation?
If so, try this....
ACD Time (min) = VAR TotalSeconds=SUMX(ALLSELECTED('agent_interval') ,HOUR('agent_interval'[acdTime_i_HHMMSS])
HI @Chas2002
Plus I think there is a better way to format your result. Do you have some sample data from your 'agent_interval'[actTime_i_HHMMSS] column including your desired output for the data. Oh and what is the datatype for that column?
| User | Count |
|---|---|
| 49 | |
| 37 | |
| 33 | |
| 22 | |
| 18 |
| User | Count |
|---|---|
| 132 | |
| 99 | |
| 56 | |
| 37 | |
| 37 |