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
Anonymous
Not applicable

Conditional Line chart

Hello,

 

I have a trouble to make a measure to calculate average amounts of countries for years in line chart.

When column ID is filtered with a slicer, a measure is needed to visualize the average amonts for countries and years on the line chart.

 

I really need a help

Thanks advance!

 

Screenshot (14).png

This is the line chart when slicer is not filtered.This is the line chart when slicer is not filtered.This is the line chart when slicer is filtered . I need a line chart shown with average amounts of countries over years  when I select ID in slicer.This is the line chart when slicer is filtered . I need a line chart shown with average amounts of countries over years when I select ID in slicer.

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

Is this the result you want?

vcgaomsft_0-1649386498160.png

If yes, try this measure.

Average over country = CALCULATE(DIVIDE(SUM('Table'[Amount]),COUNTROWS('Table')),ALLEXCEPT('Table','Table'[Id]))

Attach the PBIX file for reference. Hope it helps.

 

If I misunderstood what you needs, please feel free to tell me the result you want and how to calculate it.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems with it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Anonymous
Not applicable

Thank you for your time and reply.

 

The measure you typed is working fine and there is nothing wrong with it. But still the line chart visual doesn't take a form that we need. Actually I even don't know if it is possible to form the line chart visual the way we want. We just want to give it a shot 🙂


Anyway, thank for your reply and suggestion again!

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.