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.
Hello Team,
I have 3 years of data and counting in my data set. Date column is in the format of 2018.02, 2018.03 etc..I should have two slicers to select year and month. Based on the selection of slicers I need to show previous 12 months of data. Can I achieve this using paramters? If yes, can you show me the way please. It should be flexible to change the values as well to view different range of date values of data.
Also appreciated, if the solution can work for Power BI service as well.
Ex:
Parameter 1 : 2017, Paramter 2: 08
Output should be like:
2016.09 to 2017.08 data
Thanks in advance.
Regards,
Shiva
You may try to create measure as below. Here is the reference for you.
Measure = VAR par1 = SELECTEDVALUE ( 'Slicer'[Year] ) VAR par2 = SELECTEDVALUE ( 'Slicer'[Month] ) RETURN CALCULATE ( MAX ( 'Table'[YearMonth] ), FILTER ( 'Table', 'Table'[Date] >= EDATE ( DATE ( par1, par2, 31 ), -11 ) && 'Table'[Date] <= DATE ( par1, par2, 31 ) ) )
Sample file is here.
Regards,
Cherie
Hello Team,
I have 3 years of data and counting in my data set. Date column is in the format of 2018.02, 2018.03 etc..I am having two slicers to select year and month. Based on the selection of slicers I need to show previous 12 months of data.
Also appreciated, if the solution can work for Power BI service as well.
Ex:
Slicer 1 : 2017, Slicer 2: 08
Output should be like:
2016.09 to 2017.08 data
Thanks in advance.
Regards,
Shiva
Basically something along the lines of:
Measure = VAR __param1 = MAX('Table'[Parameter 1]) VAR __param2 = MAX('Table'[Parameter 2]) RETURN SUMX(FILTER('Table',([Year]>=__param1-1&&[Month>__param2)&&([Year]=__param1&&[Month]<=__param2)),[Data])
Tough to be specific without data. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
93 | |
75 | |
62 | |
50 |
User | Count |
---|---|
147 | |
107 | |
105 | |
87 | |
61 |