Forum Discussion
kdaya
Helper I
8 years agoHow to view first 3 months
Hi Power BI Community, Please can someone help me on how i can view the first 3 months of data: basically each customer has a different starting date so i cannot use the slicer as this uses t...
v-haibl-msft
Microsoft Employee
8 years ago
You can create a YearMonth column and then rank the YearMonth for each user. So that we can filter the first 3 months for each user easily.
For details, please refer to attached PBIX file.
YearMonth =
YEAR ( Sheet1[Created Time] ) * 100
+ MONTH ( Sheet1[Created Time] )
RankYearMonth =
RANKX (
FILTER ( Sheet1, Sheet1[Account] = EARLIER ( Sheet1[Account] ) ),
Sheet1[YearMonth],
,
ASC,
DENSE
)
Best Regards,
Herbert
kdaya
Helper I
8 years agothanks for your help, can you please tell me why you *100?
- v-haibl-msft8 years ago
Microsoft Employee
Just give a good format for the YearMonth column which data type is whole number, so that we can rank it correctly.
We can also not *100, but in that case, YearMonth will be 2016 +5 = 2021 instead of 201600 + 5 = 201605.
Best Regards,
Herbert - v-haibl-msft8 years ago
Microsoft Employee
If your problem has been resolved, you can mark the right answer as solution so that other ones who have the same problem can find the solution quickly.
Best Regards,
Herbert