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.
I have two filter in report, one for fiscal year & other for fiscal month. On current selection of fiscal year & fiscal month, the entire page should last 12 month of data. Suppose if I choose "Jan" as fiscal month & "2017" as fiscal year then it must show previous 12 month of data from fiscal month Jan 2017. Please Guide...
Thanks in advance.
Solved! Go to Solution.
Hi @Anonymous,
Based on my test, we can take the following steps to meet your requirement.
1. Enter the data as you described, and create a new column.
Yearmonth = YEAR(Table1[date])*100+MONTH(Table1[date])
2. Create a YearMonth table and add an index column
distime = DISTINCT(Table1[Yearmonth])
MonthIndex = VAR MonthRow = distime[YearMonth] RETURN CALCULATE ( DISTINCTCOUNT ( distime[YearMonth] ), FILTER ( distime, 'distime'[YearMonth] <= MonthRow ) )
3. Create the three measures as below.
monthtocheck = CALCULATE(MAX(distime[MonthIndex]),ALLSELECTED('Calendar'[YearMonth]))
SelectMonthIndex = CALCULATE ( MAX ( distime[MonthIndex] ), FILTER (ALL(distime), (SELECTEDVALUE(FY[Year])*100+SELECTEDVALUE('Month'[month]))=distime[YearMonth]))
Previsou 12 = IF(AND([monthtocheck]>[SelectMonthIndex]-12,[monthtocheck]<=[SelectMonthIndex]),1,0)
4. Create a table visual and filter the table making the Previsou 12 is 1. Then we can get the result as below.
For more details, please check the pbix as attached.
https://www.dropbox.com/s/y4pcfw8kburinob/On%20curren2.pbix?dl=0
Regards,
Frank
Hi @Anonymous,
Based on my test, we can take the following steps to meet your requirement.
1. Enter the data as you described, and create a new column.
Yearmonth = YEAR(Table1[date])*100+MONTH(Table1[date])
2. Create a YearMonth table and add an index column
distime = DISTINCT(Table1[Yearmonth])
MonthIndex = VAR MonthRow = distime[YearMonth] RETURN CALCULATE ( DISTINCTCOUNT ( distime[YearMonth] ), FILTER ( distime, 'distime'[YearMonth] <= MonthRow ) )
3. Create the three measures as below.
monthtocheck = CALCULATE(MAX(distime[MonthIndex]),ALLSELECTED('Calendar'[YearMonth]))
SelectMonthIndex = CALCULATE ( MAX ( distime[MonthIndex] ), FILTER (ALL(distime), (SELECTEDVALUE(FY[Year])*100+SELECTEDVALUE('Month'[month]))=distime[YearMonth]))
Previsou 12 = IF(AND([monthtocheck]>[SelectMonthIndex]-12,[monthtocheck]<=[SelectMonthIndex]),1,0)
4. Create a table visual and filter the table making the Previsou 12 is 1. Then we can get the result as below.
For more details, please check the pbix as attached.
https://www.dropbox.com/s/y4pcfw8kburinob/On%20curren2.pbix?dl=0
Regards,
Frank
Thanks for the solution.
I need one more help:
1. On another page, I have Fiscal year filter, on a current selection, it must show selection fiscal year data & previous two fiscal years of data.
2. On another page, I want a Fiscal quarter filter such that, on a current selection, it must show the selected fiscal quarter as well as previous three-quarters data.
I'm sharing you .pbix file:
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 |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |