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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
zausten
Helper I
Helper I

Create measure of sum of rows in table grouped

Hi, 

I have a table containing a transaction date, customer name and some other values.

I want to be able to apply a fitler to that table to remove records where the customer only has transactions in a single month.

So in the case below remove joe because he only has transactions in a single month

I have tried using countrows but without sucess

thanks!

Tranaction dateCustomer NameAmount
2023-01-01Joe1
2023-01-01Mary2
2023-02-01Mary3
2023-03-01Mary4
2023-04-01Mary5
2022-11-01Ted6
2022-12-01Ted7
2023-01-01Ted4
2023-02-01Ted4
2023-03-01Ted7
2023-04-01Ted8
2 REPLIES 2
zausten
Helper I
Helper I

thanks @pratyashasamal 

Thats getting closer to what I need, however never as straightforward!  the table is already being fitlered dynamically using an unlinked date table to return the previous 6 months of transactions.  we do this by below dax. this way the user can select January23 and get the last 6 months transactions from the fact table.

So what I really need is a sum of the transactions per customer on the filtered table.  Hope that makes sense

 

dynamic6monthflag =

var to_date= selectedvalue('date table'[endofmonth])

var from_date = selectedvalue('date table'[firstofmonth])

var flag =
IF(max(Table[TransactionDate]) in DATESBETWEEN(Table[TransactionDate],from_date,to_date),1,0)
return flag

pratyashasamal
Memorable Member
Memorable Member

Hi @zausten ,
First keep add the date column and other columns that you want and apply the filter to month you want .
Add a measure to count the customers

Count Customer = CALCULATE( COUNT(Orders[Order ID]), ALLEXCEPT(Orders, Orders[Customer ID]))
Then apply the filter on Count Customer to be greater than 1 
pratyashasamal_0-1674211178523.png

Thanks ,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.