Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
Please find the below Table,
| Month | User ID |
| Dec | 1154 |
| Dec | 3441 |
| Dec | 3441 |
| Jan | 1154 |
| Jan | 1154 |
| Jan | 3211 |
| Jan | 3211 |
| Jan | 5467 |
| Feb | 1154 |
| Feb | 3456 |
| Feb | 3211 |
| Feb | 3211 |
Need to calculate measure which is like, (Distinct count of user id where current month id = previous month id )/ Distinct count of Current Month id.
For the above, Jan month is 0.3 and feb month is 0.6.
| Month | Calculation |
| Jan | (1/3)=0.3 |
| Feb | (2/3)=0.6 |
Hi,
You may download my PBI file from here.
Hope this helps.
Hi,
Applogise, written the wrong condition. Now Corrected it.Please see the requirement again.
Instead of Current month mentioned as previous month.
Condition is -->(Distinct count of user id where current month id = previous month id )/ Distinct count of Current Month id.
I tried in the attached file, but its not working. Can you create the measure in the file which i have attached here?
Please click below link to access file.
https://drive.google.com/drive/folders/1Y5Oe_tbpneLgdG3xSMChIEyjaqNIBS00?usp=sharing
Thank you,
Hi,
Download the PBI file from here.
Hope this helps.
Hi,
No, this is not working. It will not show 100%, if all id matches then it will show 100%.
I need,D.Count of (User id in current month matches with User id in Previous month month) which is divided by D.Count of User id in Current month.
@Ashish_Mathur @Anonymous
Thanks,
Hi,
Please use the below Table, and result needs to come as (Jan -0.3 and Feb 0.6)
| Date | Month |
User ID |
| 27-12-2022 | Dec | 1154 |
| 27-12-2022 | Dec | 3441 |
| 07-12-2022 | Dec | 3441 |
| 27-01-2023 | Jan | 1154 |
| 02-01-2023 | Jan | 1154 |
| 02-01-2023 | Jan | 3211 |
| 16-01-2023 | Jan | 3211 |
| 22-01-2023 | Jan | 5467 |
| 12-02-2023 | Feb | 1154 |
| 21-02-2023 | Feb | 3456 |
| 21-02-2023 | Feb | 3211 |
| 16-02-2023 | Feb | 3211 |
Need to calculate measure which is like, (Distinct count of user id where current month id = previous month id )/ Distinct count of Current Month id.
For the above, Jan month is 0.3 and feb month is 0.6.
Jan month Id1154 matches with Dec and Dist.ID count of Jan is 3. So for Jan (1/3=0.3)
Feb month id1154 and 3211 matches witn Jan and Dist ID count of feb is 3. So for Feb (2/3=0.6).
| Month | Calculation |
| Jan | (1/3)=0.3 |
| Feb | (2/3)=0.6 |
Thanks
Hi,
You may download my PBI file from here.
Hope this helps.
Hi,
I Have 2 Table,
Table-A
Date User ID Type
27-Dec-22 2211 Active
27-Dec-22 3441 Active
07-Dec-22 3441 Active
27-Jan-23 2211 Active
02-Jan-23 1154 Active
02-Jan-23 3211 Active
16-Jan-23 3211 Active
22-Jan-23 5467 Active
12-Feb-23 1233 Active
21-Feb-23 3456 Active
21-Feb-23 3211 Active
16-Feb-23 1154 Active
and
Table-B
Date User ID Type
27-Dec-22 1154 Passport
27-Dec-22 3441 Passport
07-Dec-22 3441 Passport
27-Jan-23 1154 Passport
02-Jan-23 1154 Passport
02-Jan-23 3211 Passport
16-Jan-23 3211 Passport
22-Jan-23 5467 Passport
12-Feb-23 1154 Passport
21-Feb-23 3456 Passport
21-Feb-23 3211 Passport
16-Feb-23 3211 Passport
Need to calculate ,
Numerator - Distinct count of User ID in Table A that matches with Prev month of User ID from Table B
Denominator - Prev month Distinct count of user ID from table B
Result need come like below,
Date Numerator Denominator Ret(Num/Den)
Dec
Jan 1 2 0.5
Feb 2 3 0.666666667
pls help here
Hi,
I just cannot understand your requirement.
Hi,
Please find the below Table.
| Date | Month | User ID |
| 27-12-2022 | Dec | 1154 |
| 27-12-2022 | Dec | 3441 |
| 07-12-2022 | Dec | 3441 |
| 27-01-2023 | Jan | 1154 |
| 02-01-2023 | Jan | 1154 |
| 02-01-2023 | Jan | 3211 |
| 16-01-2023 | Jan | 3211 |
| 22-01-2023 | Jan | 5467 |
| 12-02-2023 | Feb | 1154 |
| 21-02-2023 | Feb | 3456 |
| 21-02-2023 | Feb | 3211 |
| 16-02-2023 | Feb | 3211 |
Need to calculate measure which is like, (Distinct count of user id where current month id = previous month id )/ Distinct count of Current Month id.
Example:
For the above,
Jan month, Id1154 matches with Dec and Dist.ID count of Jan is 3. So for Jan (1/3=0.3)
Feb month, Id1154 and 3211 matches witn Jan and Dist ID count of feb is 3. So for Feb (2/3=0.6).
results need to come like,
| Month | Calculation |
| Jan | (1/3)=0.3 |
| Feb | (2/3)=0.6 |
Thanks,
Hi @Anonymous ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create three measures.
Measure 2 = var a=SUMMARIZE(FILTER(ALLSELECTED('Table'),MONTH('Table'[date])=MONTH(EOMONTH(SELECTEDVALUE('Table'[date]),-1))),[User ID])
var b=CALCULATE(DISTINCTCOUNT('Table'[User ID]),MONTH('Table'[date])=MONTH(SELECTEDVALUE('Table'[date])),'Table'[User ID] in a)
return bMeasure 3 = DISTINCTCOUNT('Table'[User ID])Measure 4 = DIVIDE('Table'[Measure 2],'Table'[Measure 3],0)
(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
I Have 2 Table,
Table-A
Date User ID Type
27-Dec-22 2211 Active
27-Dec-22 3441 Active
07-Dec-22 3441 Active
27-Jan-23 2211 Active
02-Jan-23 1154 Active
02-Jan-23 3211 Active
16-Jan-23 3211 Active
22-Jan-23 5467 Active
12-Feb-23 1233 Active
21-Feb-23 3456 Active
21-Feb-23 3211 Active
16-Feb-23 1154 Active
and
Table-B
Date User ID Type
27-Dec-22 1154 Passport
27-Dec-22 3441 Passport
07-Dec-22 3441 Passport
27-Jan-23 1154 Passport
02-Jan-23 1154 Passport
02-Jan-23 3211 Passport
16-Jan-23 3211 Passport
22-Jan-23 5467 Passport
12-Feb-23 1154 Passport
21-Feb-23 3456 Passport
21-Feb-23 3211 Passport
16-Feb-23 3211 Passport
Need to calculate ,
Numerator - Distinct count of User ID in Table A that matches with Prev month of User ID from Table B
Denominator - Prev month Distinct count of user ID from table B
Result need come like below,
Date Numerator Denominator Ret(Num/Den)
Dec
Jan 1 2 0.5
Feb 2 3 0.666666667
Pls help here
@Anonymous
Hi @Anonymous ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a measure.
Measure = var a=SUMMARIZE(FILTER(ALLSELECTED('Table'),MONTH('Table'[date])=MONTH(EOMONTH(SELECTEDVALUE('Table'[date]),-1))),[User ID])
var b=CALCULATE(DISTINCTCOUNT('Table'[User ID]),MONTH('Table'[date])=MONTH(SELECTEDVALUE('Table'[date])),'Table'[User ID] in a)
return IF(b=0,0,DIVIDE(b,COUNTROWS(a)))
(3)We can create a calculated column.
Month name = FORMAT('Table'[date],"mmm")
(4) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Applogise, written the wrong condition. Now Corrected it.Please see the requirement again.
Instead of Current month mentioned as previous month.
Condition is -->(Distinct count of user id where current month id = previous month id )/ Distinct count of Current Month id.
I tried in the attached file, but its not working. Can you create the measure in the file which i have attached here?
Please click below link to access file.
https://drive.google.com/drive/folders/1Y5Oe_tbpneLgdG3xSMChIEyjaqNIBS00?usp=sharing
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.