Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

remove constant line from line graph

Hello,
Im stuck with a problem i dont know how to solve and why it comes up.
Srry for not knowing how to publish a picture directly in this chatbox. But as you can se in the link below i have a linechart were im geting a constant line where i shouldnt have any values.

My measure is:

Today =
CALCULATE (
COUNT ( View_Current_order_status[Order_id] );
FILTER ( ALL ( 'Today' ); 'Today'[Today_DateTime] <= MAX( 'Today'[Today_DateTime] ) ) ;FILTER( ALL ('View_Current_order_status'); 'View_Current_order_status'[Delivery_date] = TODAY()) )
 

How can i do so the line stops were there is values? i dont want the line to continue with the ranom number of 1264

https://imgur.com/a/DCkR5uQ

  • Hi Anonymous ,

    You can change your measure like so:

    Today =
    IF (
        MAX ( 'Idag'[Idag_DateTime] ) <= NOW (),
        CALCULATE (
            COUNT ( View_Current_order_status[Order_id] ),
            FILTER (
                ALL ( 'Today' ),
                'Today'[Today_DateTime] <= MAX ( 'Today'[Today_DateTime] )
            ),
            FILTER (
                ALL ( 'View_Current_order_status' ),
                'View_Current_order_status'[Delivery_date] = DATE ( 2019, 10, 3 )
            )
        ),
        BLANK ()
    )

    Best Regards,
    Icey

     

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

4 Replies

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

    Hi Anonymous 

    Check the current value and if it is blank, make the measure return blank. Then make sure the visual is not displaying blanks (in general it doesn't, by default)). You don't show your data model so I am not sure of the details but something like this:

    Today =
    IF (
        NOT ISBLANK ( Write here the code that yields the latest value, the one yopu want to check if it's Blank );
        CALCULATE (
            COUNT ( View_Current_order_status[Order_id] );
            FILTER (
                ALL ( 'Today' );
                'Today'[Today_DateTime] <= MAX ( 'Today'[Today_DateTime] )
            );
            FILTER (
                ALL ( 'View_Current_order_status' );
                'View_Current_order_status'[Delivery_date] = TODAY ()
            )
        )
    )
     

    Please mark the question solved when done and consider giving kudos if posts are helpful.

    Cheers  Datanaut

    • Anonymous's avatar
      Anonymous
      Not applicable

      AlB 
      i created table "Today" in advanced editor with the code below:

      let
      Start = Date.AddDays(Date.StartOfDay(DateTime.LocalNow()),-1),
      End = Date.AddDays(Start,2),
      Count = Number.From(End-Start)*1440,
      Calendar = Table.FromColumns({List.DateTimes(Start,Count,#duration(0,0,1,0))}, type table[DateTime=datetime]),
      #"renamed columns" = Table.RenameColumns(Calendar,{{"DateTime", "Today_DateTime"}})
      in
      #"renamed columns"

      To get every minute in todays date.

      below is a link to google drive on how my tables look like, each file is a table
      https://drive.google.com/drive/folders/1rCp-_LXvImGqnPW0Y92b1TMWdPt8XE-_?usp=sharing


  • Icey's avatar
    Icey
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

    You can change your measure like so:

    Today =
    IF (
        MAX ( 'Idag'[Idag_DateTime] ) <= NOW (),
        CALCULATE (
            COUNT ( View_Current_order_status[Order_id] ),
            FILTER (
                ALL ( 'Today' ),
                'Today'[Today_DateTime] <= MAX ( 'Today'[Today_DateTime] )
            ),
            FILTER (
                ALL ( 'View_Current_order_status' ),
                'View_Current_order_status'[Delivery_date] = DATE ( 2019, 10, 3 )
            )
        ),
        BLANK ()
    )

    Best Regards,
    Icey

     

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

  • Icey's avatar
    Icey
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    Is this problem sloved?


    If it is sloved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.


    If not, please let me know.


    Best Regards
    Icey