Forum Discussion

chrisw888's avatar
chrisw888
Frequent Visitor
3 years ago

Function for considering time active and inactive

Hello, 

 

Would anyone be able to assist me with my issue? I have four columns of data that looks like the below picture.

 

I am trying to show a table as follows using this data (note that column Power used in month) is from a different table, it does not depend on the above data.

 

 

I have this mostly set up in Power BI that I can line chart my utilisation, however this issue is causing me a problem. At the moment, i set up my site power to be the sum of the Power with an ALLEXCEPT for site, but this then returns for example 46 for site A for every month, not 22 for each month then the 24 when the previous has been decommissioned. Similarly for Site B, it returns 96 for every month, though it should show 22 for a number of days in december, then 46, then the 96. 

 

I am only showing my data on a monthly trend, but my utilisation % calculation would need to take into consideration the time active for each charger.

 

Is there anyone that could advise me on what my best solution is here?

 

7 Replies

    • chrisw888's avatar
      chrisw888
      Frequent Visitor
      Hi 
       
      Sure
       
      Site Power = CALCULATE(SUM(Aging[Power kwh]),ALLEXCEPT(Aging,Aging[Site]))
       
      Aware its not really correct, it had worked for me for most of what I am looking to do. Its only when I got to this stage i noticed it doesnt consider these sorts of situations where the site has changed.
      • eliasayyy's avatar
        eliasayyy
        Icon for Memorable Member rankMemorable Member

        ok now please explain dataset and what are you trying to achieve if its no issue like is their sny relationships , are all in in 1 table...