Forum Discussion

POSPOS's avatar
POSPOS
Post Partisan
2 years ago
Solved

How to show summarized data dynamically

Hi all, I have a requirement to show summary level data in a dot/scatter chat. Below is the sample data format I have. I have represented the data in Power BI as below: Sample file attached ...
  • Daniel29195's avatar
    Daniel29195
    2 years ago

    POSPOS 

    output : 

     

    check solution below :

     

    step 1 : 

    create a config table : 

     

    step 2 : 

    create the following measures : 

    phase 1 = 
    SUMX(
        scatter,
        DATEDIFF(scatter[start date] , scatter[step1] , day)
    )
    
    
    
    phase 2 = 
    SUMX(
        scatter,
        DATEDIFF(scatter[step1] , scatter[step2] , day)
    )
    
    
    
    phase 3 = 
    SUMX(
        scatter,
        DATEDIFF(scatter[step2] , scatter[final date] , day)
    )
    
    
    
    
    
    all phases = 
    SWITCH(
        TRUE(),
        SELECTEDVALUE(config_tbl[days_for]) = "days for phase 1" ,[phase 1],
        SELECTEDVALUE(config_tbl[days_for]) = "days for phase 2" ,[phase 2],
        SELECTEDVALUE(config_tbl[days_for]) = "days for phase 3" ,[phase 3]
    )

     

    \

     

    last step : 

    drag and drop to the visual :

     

     

    output : 

     

     

     

     

    If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution !
    It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

     

  • Daniel29195's avatar
    Daniel29195
    2 years ago

    POSPOS 

     

    change your code as below :check image .