Forum Discussion
Help with dax formula
Hi guys!
I need to create a measure that counts column "Repetidos" only once per order number (NroPedido2).
Currently the measurement is repeated for all lines.
As we can see in the image we only have 2 order numbers (001510529792R7 and 001510529792R6), I need the measurement to count only 1 time for each order.
My measurement x counts the number of orders that are repeated on a different day.
In other words, if an order number is repeated on any other different day, it counts as a repeat.
Thanks for help!
HI yforti
Try this:
Repetidos = VAR UniqueOrdersPerDay = SUMMARIZE( iFrame, iFrame[NroPedido2], iFrame[DateSession - Copiar], "OrderCount", COUNTROWS(iFrame) ) VAR RepeatedOrders = SUMMARIZE( UniqueOrdersPerDay, [NroPedido2], "DaysCount", COUNTROWS(UniqueOrdersPerDay) ) RETURN COUNTROWS( FILTER( RepeatedOrders, [DaysCount] > 1 ) )If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
2 Replies
- VahidDM
Super User
HI yforti
Try this:
Repetidos = VAR UniqueOrdersPerDay = SUMMARIZE( iFrame, iFrame[NroPedido2], iFrame[DateSession - Copiar], "OrderCount", COUNTROWS(iFrame) ) VAR RepeatedOrders = SUMMARIZE( UniqueOrdersPerDay, [NroPedido2], "DaysCount", COUNTROWS(UniqueOrdersPerDay) ) RETURN COUNTROWS( FILTER( RepeatedOrders, [DaysCount] > 1 ) )If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
- AnonymousNot applicable
Hi yforti ,
Have you solved your problem? If solved please mark the reply in this post which you think is helpful as a solution to help more others facing the same problem to find a solution quickly, thank you very much!
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.