Forum Discussion
Chanleakna123
7 years agoPost 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 Date Value Purc...
- 7 years ago
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
v-cherch-msft
7 years agoMicrosoft Employee
You may try to create a measure like below.If it is not your case,please show me the Master Outlet table.
RE-Purchased =
IF (
SUM ( 'Energy Drink'[Count on Purchased] )
>= MAX ( 'Master Outlet'[Count Outlet] ),
"Repurchased",
"No Repurchased"
)
Regards,
Cherie
- Chanleakna1237 years agoPost Prodigy
v-cherch-msft , hi the calculation works perfect , but can i have it in Column ? It will be easy to filter or slicer. of Repurchased or no Repurchased.
- v-cherch-msft7 years agoMicrosoft Employee
You may try below dax:
Column = IF ( CALCULATE ( SUM ( 'Energy Drink'[count] ), ALLEXCEPT ( 'Energy Drink', 'Energy Drink'[Customer Code ] ) ) >= RELATED ( 'Master Outlet'[Count Outlet] ), "Repurchased", "No Repurchased" )Regards,
Cherie
- Chanleakna1237 years agoPost Prodigy
Hi , when i use Date Filter , it dones't work , Measure Repurchased/No Repurchased , and Colum are different.
When i Filter "Date " , Measure- Repurchased/NoRepurchased filtered as expected , But Column - Column Calculation i used as per your mentioned was not run as date filter. you see it turns wrong .
how to solve such thing ? I want it to be filtered any slicer i used For example : Date