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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
gbarr12345
Helper V
Helper V

Customers who purchased a product for the first time in a certain period measure

Hi there,

 

I wrote a measure to get the customers who purchased a product for the first time in a certain period.

 

The formula below works but I'm trying to take it to the next level and say 'first time' for the users.

 

At the moment, 1 is pulling in but I want to change it to say 'First Time'. Please see screenshot below.

 

Any help would be appreciated.

 

gbarr12345_0-1714603430639.png

 

 

Office Supplies first time =

VAR OfficeSuppliesCustomersJanuary2015 =

CALCULATETABLE(

    VALUES(Orders[Customer Name] ),

    FILTER(

        Orders,

        Orders[Product Category] = "Office Supplies" &&

        Orders[Order Date] >= DATE(2015, 1, 1) &&

        Orders[Order Date] <= DATE(2015, 1,31)

    )

)

RETURN

COUNTROWS(

    EXCEPT(

        OfficeSuppliesCustomersJanuary2015,

        CALCULATETABLE(

            VALUES(Orders[Customer Name]),

            FILTER(

                Orders,

                Orders[Product Category] = "Office Supplies" &&

                Orders[Order Date] < DATE(2015, 1, 1)

            )

        )

    )

)

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @gbarr12345 

 

Wrap the COUNTROWS in an IF to return the desired text

 

IF (

COUNTROWS(

    EXCEPT(

        OfficeSuppliesCustomersJanuary2015,

        CALCULATETABLE(

            VALUES(Orders[Customer Name]),

            FILTER(

                Orders,

                Orders[Product Category] = "Office Supplies" &&

                Orders[Order Date] < DATE(2015, 1, 1)

            )

        )

    )

) = 1,

"First Time"

)

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

2 REPLIES 2
gbarr12345
Helper V
Helper V

That worked! Thank you so much!!

PhilipTreacy
Super User
Super User

Hi @gbarr12345 

 

Wrap the COUNTROWS in an IF to return the desired text

 

IF (

COUNTROWS(

    EXCEPT(

        OfficeSuppliesCustomersJanuary2015,

        CALCULATETABLE(

            VALUES(Orders[Customer Name]),

            FILTER(

                Orders,

                Orders[Product Category] = "Office Supplies" &&

                Orders[Order Date] < DATE(2015, 1, 1)

            )

        )

    )

) = 1,

"First Time"

)

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.