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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Super User
Super User

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.