Hello guys, I need aid in an issue regarding my line chart as seen below. I currently have a filter on the line chart so as to seperate the data displayed by years. The data the chart is pulling from comes from my sharepoint list as seen below. Any help would be appreciated!
@WarrenBelz @RandyHayes @Drrickryp
Solved! Go to Solution.
Hi @Kane2 ,
I made a sample for you:
Create a list with two years of data.
Add a line chart, set Items to the following function and select Series.
AddColumns(Filter(List26,Year="2021") As Temp ,"Y2022",LookUp(Filter(List26,Year="2022"),Temp.Season=Season).Number)
In your database it should be:
AddColumns(Filter(‘A350 Withdrawal Count’,Year="2022") As Temp ,"Y2023",LookUp(Filter(‘A350 Withdrawal Count’ ,Year="2023"),Temp.Month=Month).Withdrawal Count’)
Set the number of Series to display.
Best Regards,
Wearsky
Hi @Kane2 ,
I made a sample for you:
Add a dropdown in app.
Set 'items' to the following function.
If(Dropdown1.Selected.Value="All",AddColumns(Filter('A350 Withdrawal Count',Year="2022") As Temp,"Y2023",LookUp(Filter('A350 Withdrawal Count',Year="2023"),Temp.Month=Month).'Withdrawal Count'),AddColumns(Filter('A350 Withdrawal Count',Year=Dropdown1.Selected.Value) As Temp,"Y2023",LookUp(Filter('A350 Withdrawal Count',Year="2022"),Temp.Month=Month).'Withdrawal Count'))
Set the number of Series to display.
If(Dropdown1.Selected.Value=”All”,2,1)
Best Regards,
Wearsky
P.S. sorry i forgot to aid this in the original post. I am looking to develop a feature which can display both the lines of 2022 and 2023 in one chart.
Hi @Kane2 ,
I made a sample for you:
Create a list with two years of data.
Add a line chart, set Items to the following function and select Series.
AddColumns(Filter(List26,Year="2021") As Temp ,"Y2022",LookUp(Filter(List26,Year="2022"),Temp.Season=Season).Number)
In your database it should be:
AddColumns(Filter(‘A350 Withdrawal Count’,Year="2022") As Temp ,"Y2023",LookUp(Filter(‘A350 Withdrawal Count’ ,Year="2023"),Temp.Month=Month).Withdrawal Count’)
Set the number of Series to display.
Best Regards,
Wearsky
The code doesn't seem to work? Any help with regards to this?
@v-xiaochen-msft Apologies it works now, just had some minor issues with my code. One last thing, is there a way I could possibly filter the chart based on the year using a dropdown per se, such as when the user selects 2022, it will only display the line for 2022, vice versa for 2023 and when the user selects all, the chart will then display both lines. Much appreciated!
Hi @Kane2 ,
I made a sample for you:
Add a dropdown in app.
Set 'items' to the following function.
If(Dropdown1.Selected.Value="All",AddColumns(Filter('A350 Withdrawal Count',Year="2022") As Temp,"Y2023",LookUp(Filter('A350 Withdrawal Count',Year="2023"),Temp.Month=Month).'Withdrawal Count'),AddColumns(Filter('A350 Withdrawal Count',Year=Dropdown1.Selected.Value) As Temp,"Y2023",LookUp(Filter('A350 Withdrawal Count',Year="2022"),Temp.Month=Month).'Withdrawal Count'))
Set the number of Series to display.
If(Dropdown1.Selected.Value=”All”,2,1)
Best Regards,
Wearsky
Hi @v-xiaochen-msft majority of this solution works, however, when I select 2023 in the drop down, the line chart does not change to the appropriate dataset. How do I rectify this issue?
@v-xiaochen-msft Apologies it works now, it was just a mistake on my part when I inputted the wrong series in order. Much appreciated!
User | Count |
---|---|
260 | |
110 | |
97 | |
56 | |
39 |