Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register 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 |
|---|---|
| 50 | |
| 40 | |
| 32 | |
| 14 | |
| 13 |
| User | Count |
|---|---|
| 83 | |
| 71 | |
| 37 | |
| 27 | |
| 24 |