Forum Discussion
iandespradel
5 years agoRegular Visitor
Help with Visuals and Making Measures or Calculated Columns, %Days Worked, %Broken %Standby
I work in a company that lends equipment and machinery for construction projects. I have +100 equipment, each identify by an unique ID. I have a log of all the borrowed equipment.(Status: "Ac...
- 5 years ago
iandespradel , Try like
% of the days Broken =
var _tot = countx(equipment,equipment[ID])
return
divide(calculate(distinctcount(Table[ID.Equip]), filter(Table, Table[Status] ="Broken")), _tot)% of the days Active=
var _tot = countx(equipment,equipment[ID])
return
divide(calculate(distinctcount(Table[ID.Equip]), filter(Table, Table[Status] ="Active")), _tot)
Anonymous
5 years agoNot applicable
Hi iandespradel ,
Based on your description, you can do some steps as follows.
- Create a new table that contains all three status.
NEW = CROSSJOIN(ALLSELECTED('00_CONTROL'[Fecha]),ALLSELECTED(iBD_Equipos[Ficha]))
- Add two columns.
Status =
var x1=MAXX(FILTER(ALL('00_CONTROL'),'00_CONTROL'[Fecha]=EARLIER('NEW'[Fecha])&&'00_CONTROL'[Ficha]=EARLIER(NEW[Ficha])),[ID.StatusEq])
return
IF(x1<>BLANK(),x1,0)
Ca_Status = SWITCH([Status],1,"Active",2,"Broken",0,"Standby")
- Create a measure.
_total = CALCULATE(COUNT('NEW'[Ficha]),ALLEXCEPT(NEW,NEW[Fecha],NEW[Ca_Status],'NEW'[Fecha].[Month]))
- Create a 100% stacked chart.
Result:
Hope that's what you were looking for.
Best Regards,
Yuna
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.