Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi, As a novice user, im struggling to write a query (DAX, Power Query or M query) to accomplish something here. I have three tables: Users, Calendar and Users By Week:
Based on the UsersByWeek and Calendar tables, Blue and Yellow users have missing weeks:
I require a new column added to USERS table to store the first missing Week #(Calendar.Index) per user. If there is no missing week(as is Green and Red) then the first Week # is 0(zero). This is the desired result:
Can anyone help with achieving this please?
Solved! Go to Solution.
Hi @KumarPatel80 ,
IF you want to filter greater than 2 weeks , you can apply this measure to visual filter:
Because measure can not applt to slicer , this method can achieve your idea.
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @KumarPatel80 ,
Below is my table1:
Below is my table2:
Below is my table3:
You can create a measure to achieve it:
FirstMissingWeek1 =
VAR UserWeeks =
CALCULATETABLE(
VALUES('USERSBYWEEK'[WC_Date]),
'UsersByWeek'[User] = SELECTEDVALUE(USER[User])
)
VAR AllWeeks = VALUES('CALENDAR'[WC_Date])
VAR MissingWeeks = EXCEPT(AllWeeks, UserWeeks)
VAR FirstMissingWeek = MINX(MissingWeeks, 'CALENDAR'[Measure])
RETURN
IF(ISBLANK(FirstMissingWeek), 0, FirstMissingWeek)
Measure =
SELECTEDVALUE('CALENDAR'[Index])
The final output will be like this:
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi v-xiandat-msft,
That solution is perfect except is there is anyway to contain those in
@KumarPatel80 , Try measures like
M1 = countrows(userbyweek)
M2= Sumx(Values(User[user]), calculate( countx(Values(calendar[Week Year]), if(isblank([M1]), [Week Year], blank())) ))
very similar to
Power BI Items/Categories not sold to the customers: https://youtu.be/AbuKvAnicwo
Thanks for your reply.
Hi @KumarPatel80 ,
IF you want to filter greater than 2 weeks , you can apply this measure to visual filter:
Because measure can not applt to slicer , this method can achieve your idea.
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the response. Thats why I was hoping for the value to be in a column in the Users table. Is this achievable so that I can use a Slicer visual?
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 51 | |
| 40 | |
| 37 | |
| 14 | |
| 14 |
| User | Count |
|---|---|
| 85 | |
| 69 | |
| 38 | |
| 29 | |
| 27 |