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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
vanessa
Post Patron
Post Patron

Area Chart

Hi,

 

I want to create an area chart which has month (
this comes from a date column from which only the month is being pulled into the chart) on X axis and total sales on Y axis. The graph will have 2 areas: 1 for current year and 2nd for previous year. 

Something like this:

AreaGraph.png

6 REPLIES 6
ankitpatira
Community Champion
Community Champion

@vanessa so what is your question here ?

@ankitpatira

So can I achieve this?

The image i uploaded is of the Retail Analysis Sample dashboard.

I have just 1 column for date. And I want to display 2 areas: 1 for current year and 1 for the previous year.

Is it possible ?

 

@vanessa You certainly can do that. Go to query editor in power bi desktop, select your date column right click and duplicate. Then select duplicated column, under Transform tab select Date dropdown, Year and Year which will extract out year out of date. Then simply use extracted year column under Legend section of Area chart along with Category and Axis values.

@ankitpatira

I want the current year to be selected dynamically using YEAR(today()) and comparing it to the year from the date field. the aprroach you mentioned will be like a static selection. won't it?

@vanessa in that case create conditional column via query editor as where year value in year column is equal to 2016 then current year else previous year and use that conditional column in legend area. unfortunately that will also be somewhat static as you would have to update that condition column each year but currently you can't use measure (like you proposed) under Legend area of Area chart.

@ankitpatira

Is there any way i can use a dynamic filter for the graph under visual filter ?

I want to display the area graph for year greater than equal to previous year. Is it possible? or can we only use a static filter in powerbi by hardcoding the value?

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.