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
QaisAltwal
Frequent Visitor

Calculate number of distinct customers in last 90 days

Hello,

 

I need help in how to calculate the total number of distinct customers in the last 90 days. below is a sample for the file.

PowerBI Community - OneDrive (sharepoint.com)

 

thank you

4 REPLIES 4
QaisAltwal
Frequent Visitor

Actually it did not work due to "too many arguments" error.

 

can you please try again using the sample data below:

CustomerIDTransaction Date
91748153/1/2022
91748163/1/2022
91748153/1/2022
91748183/1/2022
91748153/1/2022
91748203/1/2022
91748213/1/2022
91748164/1/2022
91748154/1/2022
91748184/1/2022
91748254/1/2022
91748274/1/2022
91748284/1/2022
91748294/1/2022
91748314/1/2022
91748344/1/2022
91748354/1/2022
91748364/1/2022
91748374/1/2022
91748384/1/2022
91748394/1/2022
91748404/1/2022
91748444/1/2022
91748454/1/2022
91748464/1/2022
91748474/1/2022
91748484/1/2022
91748494/1/2022
91748514/1/2022
91748524/1/2022
91748544/1/2022
91748554/1/2022
91748564/1/2022
91748574/1/2022
91748594/1/2022
91748254/2/2022
91748274/2/2022
91748284/2/2022
91748294/2/2022
91748314/2/2022
91748344/2/2022
91748674/2/2022
91748684/2/2022
91748694/2/2022
91748704/2/2022
91748714/2/2022
91748724/2/2022
91748754/2/2022
91748764/2/2022
91748774/2/2022

All is ok, thank you all for the support.

v-yangliu-msft
Community Support
Community Support

Hi  @QaisAltwal ,

I don't have permission to access your data, I created some myself

vyangliumsft_0-1655880391102.png

Here are the steps you can follow:

1. Create measure.

Measure =
CALCULATE(DISTINCTCOUNT('Table'[Customer])
,
 FILTER(ALL('Table'),
'Table'[Date]>=
DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())-90)&&'Table'[Date]<=TODAY()))

2. Result:

vyangliumsft_1-1655880391103.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

YukiK
Impactful Individual
Impactful Individual

I haven't looked at the file you attached, but you should be able to something like this! 

 

CALCULATE (

    [DISTINCT CUSTOMERS],

    DATESINPERIOD (

        'Date'[Date],

        MAX ( 'Date'[Date] ),

        -90,

        DAY

    )

)

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.