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.
Hi all,
I want to compare previous year with current year. In that comparison i want to assign all the starting date of the all the months of previous year as "X" and the rest is "Y" and ending date of all the months of current year as "X" and the rest is "Y".If i add next year data the position of "X" and "Y" should change dynamically as we are now camparing the current year with next year. i used switch statement and assigned for 2018 and 2019 but if i add 2020 i goes wrong. how do i do it dynamically?
This is the formula i have used:
Hi @Anonymous ,
Did you have a CALENDAR table? How about changing the formula as below?
List = SWITCH(INT('Table'[Year]), 2018, if('Table'[day]=STARTOFMONTH('CALENDAR'[date]),"X","Y"), 2019, if('Table'[day]=ENDOFMONTH('CALENDAR'[date]),"X","Y") )
I have used calender table
Thank you for your Reply,
I will explain clearly,
The Sales ("Y") effect should be assessed every month on the same number of days and similar in nature(a Monday being compared to a Monday, and a Saturday to a Saturday). Any extra day is considered as Calendar effect ("X"). The month of June 2015 started on a Friday and ended on a Saturday, whereas the month of June 2014 started on a Thursday and ended on a Friday. Consequently, both the 1st Thursday of June 2014 and the last Saturday of June 2015 are considered as Time ("X") effect and the rest is ("Y").
Now i should assign all the matching days (days similar in nature) as "Y" and the not similar days as "X".
How should i assign it dynamically?
Can you share sample data with expected results?
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 |
---|---|
107 | |
99 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |