Forum Discussion
SAPpowerbi
3 years agoHelper II
duplicate values count based on another column values
Hello Team , I want count based on business line for category 1,Please help me to write a dax column . Please find below tabel for example. I want output based on category 1 and business Line ...
- 3 years ago
Hi, SAPpowerbi
You can try the following methods.
Column = CALCULATE ( COUNT ( 'Table'[Category 1] ), FILTER ( 'Table', [Category 1] = EARLIER ( 'Table'[Category 1] ) ) )Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
johnt75
3 years agoSuper User
Try
Calc column =
CALCULATE (
COUNTROWS ( 'Table' ),
ALLEXCEPT ( 'Table', 'Table'[Category 1], 'Table'[Business Line] )
)
- SAPpowerbi3 years agoHelper II
Hi thank you for quik responce .Need small help on the same dax = like category1 A two times and business line is Export and Import so my expected count is 2 , as per your dax its counting 1
Your dax output is like below =
Category 1 Business Line calculated column A Export 1 A Import 1 I need below output
Category 1 Category 2 Business Line calculated column A AB Export 2 A Ac Import 2 *** Note - I want Category1 with multiple business line so it will give me count .
I want output like above kindly help , Thnk you .
- johnt753 years agoSuper User
Try changing it to
Calc column = CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[Category 1] ) )