Forum Discussion

DigitalAutomat's avatar
DigitalAutomat
Regular Visitor
5 years ago
Solved

Wrong graph

Hi,

 

I have a problem in creating a line graph:

 

I use some calculated measures (as you can see from the following pictures)

 

and the result is this:

 

 

But instead I need the following graph:

 

 

Any idea on how to fix that?

 

Thank you very much

  • Hi DigitalAutomat,

     

    Each of your measures needs to be associated with the date column on the x-axis so that the date column can be used as the context for the metric, otherwise, each measure will only show the maximum or minimum value.

    For examples:
    The following figure date column and sales column in the same table, they are displayed normally.

    The following chart shows that the date column and the sales column are not in the same table and are not linked。

    After adding a relationship:

    Or you can create measure as:

    Measure = 
    CALCULATE(
        MAX('Table'[Sales]),
        FILTER(
            'Table',
            'Table'[Date]=MAX('Table 2'[Date])
        )
    )

    The demo is attached, please try it.

     

    If you still have some question, please don't hesitate to let me known.‌‌

     

    Best Regards,

    Link

     

    Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

     

     

5 Replies

  • What is on your X-Axis ?

    Your measures are supposed to work on an axis value. 

    • DigitalAutomat's avatar
      DigitalAutomat
      Regular Visitor

      Fowmy  At the moment there isn't anything but if I try to put something like a data/time this is the result:

       

      It seems that all these values are unrelated and elaborated separately from each other...

      • Fowmy's avatar
        Fowmy
        Super User

        DigitalAutomat 

        Have you created a relationship between the date table and the table where you have the data for the measures? 
         

  • v-xulin-mstf's avatar
    v-xulin-mstf
    Community Support

    Hi DigitalAutomat,

     

    Each of your measures needs to be associated with the date column on the x-axis so that the date column can be used as the context for the metric, otherwise, each measure will only show the maximum or minimum value.

    For examples:
    The following figure date column and sales column in the same table, they are displayed normally.

    The following chart shows that the date column and the sales column are not in the same table and are not linked。

    After adding a relationship:

    Or you can create measure as:

    Measure = 
    CALCULATE(
        MAX('Table'[Sales]),
        FILTER(
            'Table',
            'Table'[Date]=MAX('Table 2'[Date])
        )
    )

    The demo is attached, please try it.

     

    If you still have some question, please don't hesitate to let me known.‌‌

     

    Best Regards,

    Link

     

    Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!