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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
manideep547
Helper III
Helper III

Count

Hi all,
We have to show the count of customers. In my table I am having Customer ID, Zone Category values are (Retail, F&B, L&E) Count of each unique customer who started in the "Retail" category and then visited the "F&B" category right after - The count should be based on a two-point relationship that showcases the customers who convert from "Retail" to "F&B" as a direct link/flow the customers who convert Retail to F&B who visit "Retail" stores are ##% likely to visit "F&B" stores
INPUT
CustomerId   Zone Category   session start                               session_end                                         Date
1                        Retail               2020-01-06 02:21:41.000          2020-01-06 02:22:46.000                     2020-01-06
2                        F&B                 2020-01-06 16:05:50.000          2020-01-06 16:12:34.000                     2020-01-06

1                        F&B                 2020-01-06 03:22:46.000          2020-01-06 10:22:56.000                     2020-01-06

2                        L&E                 2020-01-10 18:55:23.000           2020-01-10 20:00:00:00                       2020-01-10 
need DAX Expression that comes the out like below for card visualization

customer 1 start his/her journey with Retail and convert to F&B then the count should be 1 (Retail -F&B)
customer 2 convert F&B to L&E then the count should be 1(F&B-L&E)

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

This will give what is next Zone Category In the same row. Create a new column

minx(filter(table,table[CustomerId] = earlier(table[CustomerId]) && table[session start] > earlier(table[session start])),table[Zone Category])

 

This can be used to calculate.

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

HI @manideep547 ,

Maybe you can try to use the following measure formula to calculate the category count of a specific customer:

Measure =
VAR currDate =
    MAX ( Table[session start] )
RETURN
    CALCULATE (
        COUNTA ( Table[Zone Category] ),
        FILTER ( ALLSELECTED ( Table ), [session start] > currDate ),
        VALUES ( Table[CustomerID] )
    )

Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

This will give what is next Zone Category In the same row. Create a new column

minx(filter(table,table[CustomerId] = earlier(table[CustomerId]) && table[session start] > earlier(table[session start])),table[Zone Category])

 

This can be used to calculate.

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

For direct query mode, minx not allowed for the calculated column. Here I need to display the count 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors