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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Create a new table based on date slicer

I have a table of data (TABLE_A), which I want to group by PersonID, based on a date slicer.

 

If I selected on the date slicer 01/02/2022 to 04/03/2022, then I want to have the TABLE_OUTCOME.

 

Can someone help please?  I've tried to use SUMMARIZE, but the date filter is not affecting the output.  I'm thinking I need to use CALCULATETABLE, but can't figure it out.

 

Thanks.

 

TABLE_A  TABLE_OUTCOME
     
DatePersonID PersonIDCount
01/01/2022111 1112
01/02/2022111 2222
02/02/2022111 3331
03/03/2022222   
04/03/2022222   
04/03/2022333   
1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

I think you need to create a separate date table and then try the following formula:

vhenrykmstf_0-1646892915524.png

M_ = 
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Date] <= MAX ( 'Table 2'[Date] )
            && 'Table'[Date] >= MIN ( 'Table 2'[Date] )
            && 'Table'[PersonID] = MAX ( 'Table'[PersonID] )
    )
)
Table 2 = CALENDAR("2022-01-01","2022-04-03")


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

I think you need to create a separate date table and then try the following formula:

vhenrykmstf_0-1646892915524.png

M_ = 
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Date] <= MAX ( 'Table 2'[Date] )
            && 'Table'[Date] >= MIN ( 'Table 2'[Date] )
            && 'Table'[PersonID] = MAX ( 'Table'[PersonID] )
    )
)
Table 2 = CALENDAR("2022-01-01","2022-04-03")


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

PaulDBrown
Community Champion
Community Champion

Create a measure to use as a filter in the fiter pane for a table visual containing the ID field

filter measure = COUNTROWS(VALUES(Table[ID]))

add this measure to the filter pane for the visual and set the value to equals 1





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






serpiva64
Solution Sage
Solution Sage

Hi,

if this is what you want:

serpiva64_1-1646672709436.png

you don't need any measure. You have only to add to your visual PersonID (Don't summarize) and again PersonID (Count).

if you need a measure :

CountPersonID = count('Table'[PersonID])
 

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

 and accepting it as a solution !

 

 

 

Anonymous
Not applicable

Sorry my mistake, I should have given you the full picture.  In the end, I want to create a visualisation that shows me each group of count and how many people have that value - and this to update when you change the date filter.  So looking at the original query and based on the date filter, I have two people with 2 counts, and one person with 1 count.  Not the best example to use, but hope you can see what I am trying to achieve.  Below chart is my desired output from this exercise.

 

I don't think the above solution would help, as I can't create a visualisation from a table visualisation.

 

cchow_1-1646729645527.png

 

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors