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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Mfouyer
Regular Visitor

Count repeated data between two bases

Hi there. I need a help. 

 

I need count repeted data between two bases. 

 

Base A - Calendar: Contain all date of a month (date no repeat)

Base B - Ticket registration: Contains many records throughout the month (more than one record for each day of month )

 

I need include a column in table Base A - Calendar to count how many times the records of table Base B - Ticket registration appears according a date in Base A.

 

Ex: Table B there is 4 records in day 20 and 9 records in day 25:

 

Tabble A - Caledar

Mfouyer_0-1652956416288.png

 

Thanks so much

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Mfouyer ,

 

Try the below formula:

Column =
VAR dul =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        ALLEXCEPT ( 'Table', 'Table'[Date], 'Table'[Record] )
    )
RETURN
    IF ( dul = 1, 0, 1 )
M =
VAR row_total =
    CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[Date] ) )
VAR row_dul =
    CALCULATE ( SUM ( 'Table'[Column] ), ALLEXCEPT ( 'Table', 'Table'[Date] ) )
RETURN
    row_total - row_dul

vhenrykmstf_0-1653296290773.png

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

1 REPLY 1
v-henryk-mstf
Community Support
Community Support

Hi @Mfouyer ,

 

Try the below formula:

Column =
VAR dul =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        ALLEXCEPT ( 'Table', 'Table'[Date], 'Table'[Record] )
    )
RETURN
    IF ( dul = 1, 0, 1 )
M =
VAR row_total =
    CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[Date] ) )
VAR row_dul =
    CALCULATE ( SUM ( 'Table'[Column] ), ALLEXCEPT ( 'Table', 'Table'[Date] ) )
RETURN
    row_total - row_dul

vhenrykmstf_0-1653296290773.png

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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