Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
balu810
Advocate I
Advocate I

Distinct count of users as per date filter and the sequence of events

 

i have data of people doing few steps like below

 

User IDSessionStepDate
1011101-04-2022
1012203-04-2022
1012303-04-2022
1013404-04-2022
1021105-04-2022
1022205-04-2022
1023306-05-2022

 

 

i am trying to create a funnel to count distinct users at each step and i am using date slider to slice date at week level 

 

when i filter date the table has to get filtered as per my slicer selection and the users who has done the first step in the time range selected should be counted during entire funnel . but when i am using a measure of count (users) it is counting users though the user doesnt have dont step 1 in the same week .

 

Example :

 

current out put : date range selected 04-04-2022 to 06-04-2022

 

in the below output step 3 should be 1 insead of 2 as only user 2 has intiated step 1 in the selected date range 

 

  04-06-2002 to 06-05-2022
 Count  
step11 
step21 
step32 
step41 

 

Expected output :

  04-06-2002 to 06-05-2022
 Count  
step11 
step21 
step31 
step41 

 

@Ashish_Mathur 

@JihaiXia 

@Jihwan_Kim 

@dm-p 

@KerKol 

@VahidDM 

@v-syr 

@v-sree 

@v-saia 

@Anonymous 

@PC2790 

@v-easonf-msft 

@v-eachen-msft 

@v-xiaotang 

@V-lianl-msft 

4 REPLIES 4
v-jingzhang
Community Support
Community Support

Hi @balu810 

 

You can add a Date table into the model and keep it disconnected from the original fact table. Use Date table's date column in the slicer. Then create the following measure to calculate the distinct count of users for each step. 

Measure = CALCULATE(DISTINCTCOUNT('Table'[User ID]),'Table'[Step]=SELECTEDVALUE('Table'[Step]),'Table'[Date]>=MIN('Date'[Date]),'Table'[Date]<=MAX('Date'[Date]))

vjingzhang_0-1649767416597.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

 

balu810_0-1649831810466.png

 

only users who has the intiated step 1 during the date range selection should be considered in  caluclation.

 

as per above test data user 101 did step 4 on 4th April 2022 and his latest step 1 is not in the date range of filter selection which means he didnot have step 1 intiated in the date range selected hence for step 4 it should be 0 or null

amitchandak
Super User
Super User

@balu810 , Try a measure like

 


new measure =
var _1 calculate(distinctCOUNT(Table[Step]),filter(allselected(Table), Table[User ID] = max([User ID]) && Table[Step] <= Max(Table[Step])))
return
countx(filter(Values(Table[User ID]), _1 = max(Table[Step])), Table[Step])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

balu810_0-1649238167117.png

 

Getting error when i am trying to replace the columns as per my data , below is the error

 

balu810_1-1649238223747.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.