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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Syndicate_Admin
Administrator
Administrator

Number of customers listed with DAX

Hello good morning,

I have a customer table where I have created a custom column which identifies customers according to their sale, if 90 days ago it is customer 1, more than 90 customer 2 and the rest is customer 3

First I calculate the days since the last purchase with

RangoDias = DATEDIFF([FechaUltimaCompraCliente],NOW(),DAY)

Then I identify the customer

Tipo Cliente = 
    SWITCH(
        TRUE(),
        AND(Clientes_sql[RangoDias]>0,Clientes_sql[RangoDias]<=90),1,
        Clientes_sql[RangoDias]>90,2,
        3
        )

Now what I want to do is count the number of rows (customers) of a particular type.

For example 2 customers, I have a matrix where they appear, now I would like the data of how many (in number) there are in that list.

apenaranda_0-1700548203702.png

Thank you.

1 REPLY 1
KNP
Super User
Super User

Unless I'm misunderstanding, can you not just drop in a measure.

DISTINCTCOUNT('Customer'[CustomerName])

 

Put that in the matrix.

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.