Forum Discussion
Fathers day comparison
- Anonymous5 years ago
Justas4478
Please refer to my example below.1. Lets if you have date column from 2018 to 2021, first enter the date of father's days in a new table.
2. Next, you can create a flag column something can be like this.
3. Then you can just create table visual.
4. To get the difference between this current year fathers day and last year fathers day, you may use following measure.
Diff measure = var current_fathsday_sales= CALCULATE(SUM('Table'[Sales]),FILTER('Table',[Fathers day]="Yes")) var pre_fathsday_sales = CALCULATE(SUM([Sales]),FILTER(ALL('Table'),[Date]=CALCULATE(MAX([Date]),FILTER(ALL('Table'),[Date]<MAX([Date])&&[Fathers day]="Yes")))) Return current_fathsday_sales-pre_fathsday_salesPaul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
Justas4478 , You need to have a flag for the father day on the calendar
and you can use a measure like
This Year = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank]) && 'Date'[father day] =1 ))
Last Year = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank])-1) && 'Date'[father day] =1 ))
Sorry I am new to power bi. How do you create flag for it in the calendar?