Forum Discussion
lct14558
10 years agoNew Member
date no weekly hierarchy
Hi all, first post here! New to PowerBI here, avid user of Python notebook and Excel. I want to do something very simple. I have two columns of data. First column has Names, second colu...
v-caliao-msft
Microsoft Employee
10 years agoHi Lct15558,
According to your description, you need to count the distinct users for each week in each month, right?
If that is the case, you can create a calculated column to get the week number in each month, and create a calculated measure to get the distinct users in that month. Here is the sample DAX expression for you reference.
Week = YEAR(WeekHierarchy[Date])&RIGHT("00"&MONTH(WeekHierarchy[Date]),2)&"-"&CEILING(DAY(WeekHierarchy[Date])/7,1)
CountForWeek = CALCULATE(DISTINCTCOUNT(WeekHierarchy[UserID]),ALLEXCEPT(WeekHierarchy,WeekHierarchy[Week]))
Regards,
Charlie Liao