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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
obriaincian
Resolver I
Resolver I

Add a third line to line chart based on measure

Hi All,

 

I currently have an area chart:

X-Axis: Date

Y-Axis: Measure 1 - Counts the number of products for current month

            Measure 2 - Filter for the date selected via selected value in a slicer and count products per expiry date.

 

 

 

The area chart is working fine with these, but now I'm looking to add another dimention to the Y-Axis.

I want to Filter my dataset for the selectedvalue date selected and then I want to add a year to each cell in the expiry date column and count the products for each date.

 

DateProductsExpiry Date
Jan-21Chicken11-Jan-22
Jan-21Duck15-Feb-22
Feb-21Ham30-Jan-22
Feb-21Chicken15-Feb-22
Feb-21Ham15-Feb-22
Mar-21Ham30-Jan-22
Apr-21Beef07-Jan-22
Apr-21Beef12-Jan-22

 

e.g. if the SELECTEDVALUE Jan then I want to filter the dataset for Jan data. Then I want to add a year onto each date in the expiry column and then count products for each date.

 

I assume there's a measure for this but I'm struggling to find a solution at the moment

 

2 REPLIES 2
MFelix
Super User
Super User

Hi @obriaincian ,

 

When you refer you want to add a year per each value of the expiry date means that for example a value of January 2021 will be on January 2022 is this it?

 

Believe I'm not understanding your need since if it's like I'm assuming the chart would give you a line exactly like the one you already have since the values would be based on the original date +1. 

 

Can you please provide more insights on what you need, if possible with an example.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix 

Here is a sample file Sample Dashboard 

 

What I want to do now is add a year to each expiry date and draw a third line to represent the count of products for this new date (you're right if the count for a particular product was 3 for the 13-jan-21 then the new line will show 3 for 13-jan-22).

 

Please note this is only sample data and there is no real sense as to what I'm trying to do but this will be helpful with the data I'm working with offline.

 

Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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