Forum Discussion
Count Rows Range of Years
- 3 years ago
Hello again
Sorry if you didn't explain me better,
IF(YEAR(Calendar[Date]) >= 2015 && YEAR(Calendar[Date]) <= 2020, "True","False")
"Calendar" you must change it to the name of the database, "Date" should change it to the column where you have specified the year.
As I have seen in the capture of the other message that you have answered you have the column called "Year" and you only have the year indicated, so you should change the calculated columns that I told you before as follows:2009 a 2014:
Rango2009-2014 = IF("Nombre_Base_Datos"[Año] >= 2009 && "Nombre_Base_Datos"[Año] <= 2014, "True","False")2015-2020:
Range2015-2020 = IF"Nombre_Base_Datos"[Year] >= 2015 && "Nombre_Base_Datos"[Year] <= 2020, "True","False")
I will attach a couple of screenshots indicating how to create the calculated columns to make everything clearer.
I've replicated the example you've posted to try to help you as much as possible.
I hope it has become clearer and if it has helped you do not forget to score!
Greetings,
Esteban - 3 years ago
there a variety of ways you can do this. Pie charts are not that easy to do comparisons, either clustered or stacked bar charts are easier. If you decide to use the 2 pie charts, you need to filter the group-range calculated column in the filter pane to select the group you want in that chart.
filter pane
i re attach the file with the visuals in them, and yes this is the same calculated column i created with the count measure
Hi Esteban,
Thank you for your help, though i'm afraid I'm not sure how to use the formulas you provided. What is calendar? How do i create a calculated column?
I'm so sorry for the trouble! Thank you
Hello again
Sorry if you didn't explain me better,
IF(YEAR(Calendar[Date]) >= 2015 && YEAR(Calendar[Date]) <= 2020, "True","False")
"Calendar" you must change it to the name of the database, "Date" should change it to the column where you have specified the year.
As I have seen in the capture of the other message that you have answered you have the column called "Year" and you only have the year indicated, so you should change the calculated columns that I told you before as follows:
2009 a 2014:
Rango2009-2014 = IF("Nombre_Base_Datos"[Año] >= 2009 && "Nombre_Base_Datos"[Año] <= 2014, "True","False")
2015-2020:
Range2015-2020 = IF"Nombre_Base_Datos"[Year] >= 2015 && "Nombre_Base_Datos"[Year] <= 2020, "True","False")
I will attach a couple of screenshots indicating how to create the calculated columns to make everything clearer.
I've replicated the example you've posted to try to help you as much as possible.
I hope it has become clearer and if it has helped you do not forget to score!
Greetings,
Esteban
- Anonymous3 years agoNot applicable
Thanks Esteban! The screenshots were super helpful!
Do you know if there's any way to use that column then to make a pie chart?
The goal is to make a pie chart that consists only of the data that falls between those ranges (2009-2014 and 2015-2020), but that includes the strains. As of now, when I try to make a pie chart with 2009-2014 column, and "strain" as the legend, I still get all the data from the entire spreadsheet.
I don't know if I explained that clearly, I'm sorry in advance