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
Chanleakna123
Post Prodigy
Post Prodigy

Column Calculation not get right

Hi All , 

 

I have such below Table , Column of Purchase/No PUrchase ; Count are calculated in Edit Query , as of result this is the table  : 

Customer Code Customer Name DateValue Purchase/No Purchase Count
12345Abc1/1/201912Purchase1
12345Abc2/1/201923Purchase1
12345Abc3/1/20190No Purchase 0
45678xyz1/1/201912Purchase1
45678xyz2/1/201923Purchase1
45678xyz3/1/20193Purchase1

 

Expected Result : 

I wanna calculated which customer who re purchased and Non : 

 

If Count >=3 , Repurchased , 

If Count < 3 , No Repurchased , 

I have calculated below columns : 

 

RE-Purchased = IF('Energy Drink'[Count on Purchased]>=RELATED('Master Outlet'[Count Outlet]),"Repurchased","No Repurchased") 
but the result turn all to No Repurchased 
Customer Code Customer Name Value Purchase/No Purchase CountRepurchased/No Repurchased
12345Abc35Purchased 2No Repurchased
45678xyz38Purchased 3Re Purchased 

1.PNG

1 ACCEPTED SOLUTION

Hi @Chanleakna123 

 

Please check below dax.

Count = 
CALCULATE (
    COUNT ( 'Energy Drink'[Customer Name - Store host code] ),
    FILTER (
        ALLSELECTED ( 'Energy Drink' [Customer Name - Store host code]),
       [Repurchased/No Repurchased]= SELECTEDVALUE('Re-Purchased/No Repurchased'[Type])
    )
)

Regards,

Cherie

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

View solution in original post

12 REPLIES 12

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.