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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.