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
Tamerlane
Helper I
Helper I

filter date field1 with slicer value (date field2)

Hi there,

 

I have a problem that I cannot solve on my own. I am doing a count on contracts, which I filter with a slicer that has the date field PERIODEND. My customer wants an additional filter added: when they have contracts with an INVOICEFROM date that is later than the slicer value, they do not want to count those contracts.

 

So, when i have a contract with INVOICEFROM on februari 1st 2018, and my slicer value is january 2018 (PERIODEND equals to 31st of january 2018), the contract needs to be excluded from the count (or the max date from INVOICEFROM needs to be equal to the slicer value). How can i achieve this with a measure instead of having the customer manually change the filters every month?

date fields.jpg

 

 

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Tamerlane,

 

Please check whether this measure meets your requirement:

Count contract =
CALCULATE (
    COUNT ( 'Contract TB'[Contracts] ),
    FILTER (
        'Contract TB',
        'Contract TB'[INVOICEFROM] <= SELECTEDVALUE ( 'Contract TB'[PERIODEND] )
    )
)

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

2 REPLIES 2
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Tamerlane,

 

Please check whether this measure meets your requirement:

Count contract =
CALCULATE (
    COUNT ( 'Contract TB'[Contracts] ),
    FILTER (
        'Contract TB',
        'Contract TB'[INVOICEFROM] <= SELECTEDVALUE ( 'Contract TB'[PERIODEND] )
    )
)

Regards,

Yuliana Gu

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

That works great, thanks!

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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