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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
User
Frequent Visitor

Cohort analysis

Hi! I have a problem. It is necessary to divide in the cohort analysis the values by month with repeated transactions on the total of transactions. Should get a table with percentage. The example in the screenshot.PBIDesktop_Ihq43n9wJ1.png

I tried to use the formula: 

FORMAT(CALCULATE(DISTINCTcount(source[ID]);filter(source;source[Rank]>1))/DISTINCTCOUNT(source[ID]);"Percent") 
but i have wrong result: 
image.png
 

Thank you for your time and attention.

 

Best regards.

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @User 

Show the columns added into the "column"/"row"/“value" field.

Are the columns added in the matrix from the same table?

From your screenshot, picture 1 and picture 2 show the different grand total.

It confuses me.

 

As for your formula:

FORMAT(CALCULATE(DISTINCTcount(source[ID]);filter(source;source[Rank]>1))/DISTINCTCOUNT(source[ID]);"Percent")

you could modify your formula as below, then change the data format to percent ( in the "modeling" bar.

CALCULATE(DISTINCTcount(source[ID]);filter(source;source[Rank]>1))/DISTINCTCOUNT(source[ID])

Check if it helps.

 

Best Regards

Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I tried as you wrote, but the values ​​are incorrect.
The table contains the following fields (in the screenshot):

 PBIDesktop_jGMFpOhgIX.png2.png3.png4.png

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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