Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi
I have two tables, one is the date
I have created this date column using calendar auto function
Another table called user
There is no a relationship between these two tables.
I have created a slicer using my date column
I want to check whether the user table date available in the selected slicer date using the If condition. For example, in the User table Player A has a date of January 1 2021. I want to check whether Jan 1 2021 lies between the selected slicer date. If it is available I need to print 1 else 0.
I want to create a DAX measure to check this condition. Not sure how to do this. Tried other posts but no success. Please advise.
Solved! Go to Solution.
Hi, @Jason2500
Please try to write the below measure.
The link to the sample pbix file is down below.
Check measure =
IF (
SELECTEDVALUE ( Users[Date] ) >= MIN ( Dates[Date] )
&& SELECTEDVALUE ( Users[Date] ) <= MAX ( Dates[Date] ),
1,
0
)
https://www.dropbox.com/s/2vc7txlkggjn22q/jason2500.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Hi, @Jason2500
Please try to write the below measure.
The link to the sample pbix file is down below.
Check measure =
IF (
SELECTEDVALUE ( Users[Date] ) >= MIN ( Dates[Date] )
&& SELECTEDVALUE ( Users[Date] ) <= MAX ( Dates[Date] ),
1,
0
)
https://www.dropbox.com/s/2vc7txlkggjn22q/jason2500.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Hey @Jason2500 ,
you can tell Power BI to treat the date column from the date table as the date column from the user table.
Try the following measure and add it in the visualization to a table with the Player column from the user table:
Amount Rows =
CALCULATE(
COUNTROWS( user ),
TREATAS(
VALUES( 'date'[Date] ),
user[Date]
)
)
@selimovd Thanks for your help. I tried the above measures, but it is not checking the condition. I need to see whether the user date is available between the slicer and show 1 else 0? Can you please advise?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
61 | |
56 | |
55 | |
36 | |
34 |
User | Count |
---|---|
77 | |
73 | |
45 | |
45 | |
43 |