Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
DigitalAutomat
Regular Visitor

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)

misure calcolate.JPG

 

and the result is this:

 

grafico sbagiliato.JPG

 

But instead I need the following graph:

 

grafico giusto.JPG

 

Any idea on how to fix that?

 

Thank you very much

1 ACCEPTED SOLUTION
v-xulin-mstf
Community Support
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.

vxulinmstf_0-1630552461037.png

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

vxulinmstf_1-1630552488047.png

After adding a relationship:

vxulinmstf_2-1630552577294.pngvxulinmstf_3-1630552618874.png

Or you can create measure as:

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

vxulinmstf_4-1630552699085.png

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!

 

 

View solution in original post

5 REPLIES 5
v-xulin-mstf
Community Support
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.

vxulinmstf_0-1630552461037.png

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

vxulinmstf_1-1630552488047.png

After adding a relationship:

vxulinmstf_2-1630552577294.pngvxulinmstf_3-1630552618874.png

Or you can create measure as:

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

vxulinmstf_4-1630552699085.png

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!

 

 

DigitalAutomat
Regular Visitor

@Fowmy not really; I've just done what you can see in my last picture..

Fowmy
Super User
Super User

What is on your X-Axis ?

Your measures are supposed to work on an axis value. 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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

 

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

@DigitalAutomat 

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

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.