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
syazwan95
Frequent Visitor

How to create COUNTIF MEASURE with conditions based on user inputs from date slicer?

Hello everyone, I'm trying to do a quite simple thing, but I cant seem to find a workaway around it.

I have the following data in a table:

 

ask1.JPG

 

and the following date slicer:

 

ask2.JPG

 

What I want to do is to have an "After Period" column where if the "AB Delv Da" is later than the end date specified by the user, it will say "Yes".

 

What I've done so far is,

Last  Date from Slicer = CALCULATE(MAX( 'Date Slicer'[Date]),ALLSELECTED( 'Date Slicer'[Date]))

After period = IF(DATA[PO Doc Date] >= [First], "Yes","No")

 

However it seem to not work. Any suggestions?

1 ACCEPTED SOLUTION

@v-frfei-msft it is already a date type.

 

Okay, so I've made a few changes to it. Instead of using column, I changed it to measure. Seems to work fine.

 

Power bi.PNG

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

Try After period like

if(calculate(max(DATA[PO Doc Date]),all(DATA)) >= [First], "Yes","No")

@syazwan95  , does the above reply helps. if you need more help make me @

 

Appreciate your Kudos.

@amitchandak thanks for the reply. Ive tried it but it doesnt work. still says "yes" for all. I'm wondering if its because of the data/date type.

Hi @syazwan95 ,

 

Your [AB Delv Da] column should be text type, please change it to date to have a check agian.

 

 

Capture.PNG

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

@v-frfei-msft it is already a date type.

 

Okay, so I've made a few changes to it. Instead of using column, I changed it to measure. Seems to work fine.

 

Power bi.PNG

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.