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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
jl20
Helper IV
Helper IV

Retain date filter on summarized table

Hi,

 

I am trying to write a measure that counts rows of a summarized table (sum of shares purchased sold in the data table), which is filtered for a date range. My existing measure to sum shares purchased/sold to date works perfectly and is easily displayed in table form, changing dynamically with as the date slicer is adjusted. I'm trying to count the rows (there is one row per person), where the the sum of the transactions is > 0.

 

Data table: List of transactions with the following fields - Date, Person, Number of Shares Purchased/(Sold)

Dimension tables: Date, Person

 

If I use summarize and count the distinct rows, then it ignores the date slicer, which defeats the purpose (I get a count of everyone that has ever transacted, regardless of how many shares they currently own). Any ideas how I can create a measure that counts the total people with life-to-date share purchases/sales > 0 (in other words, the number of shareholders as of a certain date specified by the date slicer)?

 

Thank you in advance.

2 REPLIES 2
VasTg
Memorable Member
Memorable Member

 

@jl20 

 

I have 3 tables. Calender, Person and Data.. Relationships 1 to M to Data.

If i understand you correctly, this should work for you.

 

image.png

Left - Month Slicer

Middle - Expected Measure

Right - Input Data table.

 

Measure = 
VAR A = MAX('Calendar'[Date])
RETURN CALCULATE(COUNTROWS(Data),FILTER(ALL('Calendar'),'Calendar'[Date]<=A))

 

If it helps, mark it as a solution

Kudos are nice too

 

Connect on LinkedIn

That measure is counting the number of transactions by person. I'm interested in counting the number of people with >= shares as of a specific date. For example, as of 3/1/19 in the below example, the measure would return 2 (persons A and B, because they each own shares as of that date). 

 

If we assume person C sells all 90 shares on 11/2/19, the measure would return the following:

 

As of 11/1/19 = 3 (persons A,B,C)

As of 11/2/19 = 2 (persons A & B, as person C's total owned is now zero)

 

Thank you

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors