March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
Register NowGet certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
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?
Solved! Go to Solution.
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
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
That works great, thanks!
User | Count |
---|---|
122 | |
97 | |
89 | |
76 | |
69 |
User | Count |
---|---|
139 | |
115 | |
114 | |
98 | |
98 |