Forum Discussion

miqueiasrlreis's avatar
miqueiasrlreis
New Member
2 years ago
Solved

Show multiple lines in single line per date

Hello again,


I have a requirement from user to develop some kind of chart to show, by equipment, all the orders assigned to it horizontally, similar to this I did in Excel

I tried most of the timeline visuals, Gantt Charts, but nothing is even similar to this. Multi-row Card was something almost there but still not what we need.

 

My structure is as follows  (hope the table dont get messy)

EquipmentOrder IDPlanned Start DatePlanned  End DateActual Start DateActual End Date
1ORDER ABC27/02/2024 00:00:0027/02/2024 08:00:0027/02/2024 01:00:0027/02/2024 09:00:00
1ORDER XYZ27/02/2024 08:00:0027/02/2024 13:00:0027/02/2024 09:00:0027/02/2024 14:00:00
2ORDER 12327/02/2024 02:00:0027/02/2024 07:00:0027/02/2024 01:00:0027/02/2024 08:00:00
2ORDER 45627/02/2024 12:00:0027/02/2024 17:00:0027/02/2024 09:00:0027/02/2024 14:00:00

 

In other words, I need to show per equipment per line, everything that is going to be produced with dates/times.


Is there any way to do anything like this?
Thanks in advance for the help

  • miqueiasrlreis 

    output

     

     

    this is the following logic to obtain this : 

    in power query , create the table as folllowing : 

     

    you need per to create time column . 

     

    create a dimtime table : 

     

     

     

    and create a table :  dimtype with type as column name . 

     

     

     

     

    then: create a measure : 

    Measure 3 = 
    
    var selectedtime =  SELECTEDVALUE(dimtime[time])
    var selectedtype =  SELECTEDVALUE(dimtype[type])
    
    
    
    var res = 
    SWITCH(
        TRUE(),
        selectedtype =  "Planned" , 
            var orderid = 
            CALCULATE(
            MAXx(
            FILTER(
                data1,
                selectedtime >= data1[planned start time] && selectedtime <data1[planned end time]
            ),
            data1[Order ID]
            ),
            REMOVEFILTERS(dimtime)
            )
            return orderid,
    
        selectedtype =  "Actual" , 
        var orderid = 
        CALCULATE(
        MAXx(
        FILTER(
            data1,
            selectedtime >= data1[actual start time] && selectedtime <data1[actual end time]
        ),
        data1[Order ID]
        ),
        REMOVEFILTERS(dimtime)
        )
        return orderid
    
            
       
    )
    
    return res

     

    let me know if this works. 

     

     

     

    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! 🤠

     

     

     

     

     

     

     

2 Replies

  • Daniel29195's avatar
    Daniel29195
    Icon for Community Champion rankCommunity Champion

    miqueiasrlreis 

    output

     

     

    this is the following logic to obtain this : 

    in power query , create the table as folllowing : 

     

    you need per to create time column . 

     

    create a dimtime table : 

     

     

     

    and create a table :  dimtype with type as column name . 

     

     

     

     

    then: create a measure : 

    Measure 3 = 
    
    var selectedtime =  SELECTEDVALUE(dimtime[time])
    var selectedtype =  SELECTEDVALUE(dimtype[type])
    
    
    
    var res = 
    SWITCH(
        TRUE(),
        selectedtype =  "Planned" , 
            var orderid = 
            CALCULATE(
            MAXx(
            FILTER(
                data1,
                selectedtime >= data1[planned start time] && selectedtime <data1[planned end time]
            ),
            data1[Order ID]
            ),
            REMOVEFILTERS(dimtime)
            )
            return orderid,
    
        selectedtype =  "Actual" , 
        var orderid = 
        CALCULATE(
        MAXx(
        FILTER(
            data1,
            selectedtime >= data1[actual start time] && selectedtime <data1[actual end time]
        ),
        data1[Order ID]
        ),
        REMOVEFILTERS(dimtime)
        )
        return orderid
    
            
       
    )
    
    return res

     

    let me know if this works. 

     

     

     

    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! 🤠

     

     

     

     

     

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi miqueiasrlreis 

     

    PowerBI's built-in visual may not be able to meet your needs, if you want to achieve the same effect as your image, you can try using other custom visuals or using python scripts.

     

     

     

    Best Regards,

    Jayleny

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.