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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
matthewwylie
New Member

Creating a count via lookup on another table

I have a Power Bi report containing two tables

 

table 1 - Licences table

matthewwylie_0-1647448725147.png

table 2 - a date table

I created this with:

Date table = CALENDAR(MIN(Licences[Start date]), MAX(Licences[Start date]))
matthewwylie_1-1647448780770.png

 

I want to add a measure to the date table that shows how many licences were active on each date

i.e

count licence number (no. licences) from the licence table where

date table.date >= licences.start date

date table.date <= licences.expiry date

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @matthewwylie ,

 

Please refer this measure.

 

measure =
CALCULATE (
    COUNT ( 'Licences'[licence number] ),
    FILTER (
        ALLSELECTED ( 'Licences' ),
        'licences'[start date] <= SELECTEDVALUE ( 'date'[date] )
            && 'licences'[expiry date] >= SELECTEDVALUE ( 'date'[date] )
    )
)

 

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @matthewwylie ,

 

Please refer this measure.

 

measure =
CALCULATE (
    COUNT ( 'Licences'[licence number] ),
    FILTER (
        ALLSELECTED ( 'Licences' ),
        'licences'[start date] <= SELECTEDVALUE ( 'date'[date] )
            && 'licences'[expiry date] >= SELECTEDVALUE ( 'date'[date] )
    )
)

 

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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