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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.