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

TRICKY - Line and Bar Chart Plot

Hi Expert

 

I want to plot the following data on a line and clustered column chart. 

MonthPastTotal CurrentTotal PD %Year
Jan-2015.52176.328.1%2021
Feb-2020.73169.2710.9%2021
Mar-2018.15161.2910.1%2021
Apr-2019.36132.0912.8%2021
May-2013.61119.4310.2%2021
Jun-209.22138.326.3%2021
Jul-209.40155.085.7%2021
Aug-207.92163.854.6%2021
Sep-204.41177.862.4%2021
Oct-204.52191.062.3%2021
Nov-206.03191.403.1%2021
Dec-205.13174.542.9%2021
Jan-215.75173.333.2%2021
Feb-214.94175.922.7%2021
 BarBarLine 

 

The Issue is if the user select from the Month Filter Jan 20 i want to only Plot the Data upto Jan 21 (ignore feb 21) likewise if the user selects Feb 20 then plot upto Feb 21 and if we had data for Mar 21 then ignore.... When i get and include Mar 20 data the plot upto Mar 21....and so on...

1 ACCEPTED SOLUTION
sayaliredij
Super User
Super User

1. Instead of using Month Name like 'Jan 2020 ' or 'Feb 2020', you can use date eg. First day of the month. Instead of  Jan 2020 - 1 Jan 2020. Which gives you the possibility to use some time intelligence functions.
2. Create a calculated table using the following formula
    Months = DISTINCT(Table[Month])
3.  Use Slicer for the Month from this table and not from the Original table
4.  In the original table create a measure called MonthFilter
MonthFilter = 
var selectedmonth = EDATE(DATEVALUE(SELECTEDVALUE(Months[Month])),12)
RETURN
IF(MAX(Table[Month]) <= selectedmonth,1,0)
4. Create a line chart for your data 
5. In Visual level filter, add MonthFilter and set as 1 

 

Regards,

Sayali

If this post helps, then please consider Accept it as the solution to help others find it more quickly.





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

Proud to be a Super User!




View solution in original post

1 REPLY 1
sayaliredij
Super User
Super User

1. Instead of using Month Name like 'Jan 2020 ' or 'Feb 2020', you can use date eg. First day of the month. Instead of  Jan 2020 - 1 Jan 2020. Which gives you the possibility to use some time intelligence functions.
2. Create a calculated table using the following formula
    Months = DISTINCT(Table[Month])
3.  Use Slicer for the Month from this table and not from the Original table
4.  In the original table create a measure called MonthFilter
MonthFilter = 
var selectedmonth = EDATE(DATEVALUE(SELECTEDVALUE(Months[Month])),12)
RETURN
IF(MAX(Table[Month]) <= selectedmonth,1,0)
4. Create a line chart for your data 
5. In Visual level filter, add MonthFilter and set as 1 

 

Regards,

Sayali

If this post helps, then please consider Accept it as the solution to help others find it more quickly.





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

Proud to be a Super User!




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.