Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi Guys, I'm using this to select the current date selected:
Selected Date =
VAR SelectedDate = SELECTEDVALUE('Date Init'[Selected])
RETURN
IF(ISBLANK(SelectedDate) ,0 ,SelectedDate)
Then I want to compare this selected value to another table to put a flag:
Flag = IF ('Date'[Selected]=[Selected Date] ,1,0)
Someone know why the second formula is not working, and how I can solve this?
Solved! Go to Solution.
Hi @Anonymous ,
We should create meausre to work on it instead of calcualted column.
Measure =
VAR sele =
SELECTEDVALUE ( 'Table'[slicer] )
RETURN
IF (
ISFILTERED ( 'Table'[slicer] )
&& MAX ( 'Table (2)'[category] ) = sele,
1,
0
)
For more details, please check the pbix as attached.
Hi @Anonymous ,
We should create meausre to work on it instead of calcualted column.
Measure =
VAR sele =
SELECTEDVALUE ( 'Table'[slicer] )
RETURN
IF (
ISFILTERED ( 'Table'[slicer] )
&& MAX ( 'Table (2)'[category] ) = sele,
1,
0
)
For more details, please check the pbix as attached.
Thanks, your option works excellent, now I can play with this more dynamically.
Cordially,
Hey @Anonymous ,
from the syntax of your 2nd formula I deduct that this is a CALCULATED COLUMN, you have to be aware of the different steps that are creating the Power BI data model.
Step 1: Power Query (PQ) connects to various data sources, allows to transform data and sets the stage for the Power BI data model. Almost each PQ query results to a table in the Power BI data model. It's not possible to access objects that have been created by DAX from within PQ
Step 2: Data refresh, during this step data will be loaded to the Power BI data model, this is the obvious part. But also DAX based objects like calculated columns and DAX based tables are created during this step and added to data model. Interaction of users with the data model like selecting slicers will not be recognized, as this step happens before any interaction will be recognized by the data model.
Step 3: The interaction, here the data model is able to reflect interaction with the user.
For this you have to transform your second formula to a measure instead.
Hopefully this provides some additional insights.
Regards,
Tom
Having this clear, my solution for my problem is not viable, I want to do it is to filter dates using two different slicers with start and end date to do an between, my solution was to mark these two dates and then make a mark on the date table between these two implicit values to later filter the dates selected with the brand.
This is the filters:
Having that in mind how I can filter between these two different slicers?
@Anonymous seems like you are returing 0 or date based on following formula
Selected Date =
VAR SelectedDate = SELECTEDVALUE('Date Init'[Selected])
RETURN
IF(ISBLANK(SelectedDate) ,0 ,SelectedDate)
why not do this
Selected Date =
SELECTEDVALUE('Date Init'[Selected])
Flag = IF ('Date'[Selected]=[Selected Date] ,1,0)
or one measure
Flag = IF ('Date'[Selected]=SELECTEDVALUE('Date Init'[Selected]) ,1,0)
Would appreciate Kudos if my solution helped.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi thanks a lot for your help, this option does not work.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
133 | |
76 | |
53 | |
38 | |
37 |
User | Count |
---|---|
202 | |
80 | |
71 | |
55 | |
48 |