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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
YellowDog
Regular Visitor

User Selected Date Variables in Measure

I've got this measure that works as expected, but I want the users to be able to pick the desired start and end dates and have those selections dropped into the appropriate variables.  How would I do this?  Is there a date picker or something that can be utilized?

Fiscal Charges =
VAR StartDate = DATE(2021,1,1)
VAR EndDate = DATE(2021,4,2)
RETURN
SUMX(qryCharges,
IF([correction] = "N", [Total Charges],
IF([correction] = "Y" && [postingdate] < StartDate, -[Total Charges],
IF([correction]="Y" && [backoutdate] > EndDate, [Total Charges],
0) ) ) )
1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @YellowDog ,

 

sure, you can just use a slicer with your date column.

In the measure you would have to change the variables to MIN(dateTable[Date]) and MIN(dateTable[Date]).

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

2 REPLIES 2
selimovd
Super User
Super User

Hey @YellowDog ,

 

sure, you can just use a slicer with your date column.

In the measure you would have to change the variables to MIN(dateTable[Date]) and MIN(dateTable[Date]).

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

I think I got it.  I created a date table and left it disconnected.  Then I could create the date slicer which gives me a decent user interface to select the beginning and end dates.  Works great, thanks!

YellowDog_0-1617466058251.png

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.