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.
Hi all,
I am trying to return the minimum selected value of a year slicer across all years. I tried using the following code, however, it seems that SELECTEDVALUE cannot be used with a date range.
Solved! Go to Solution.
Hi,
To both visuals, drag the year column from the calendar Table (not from the Date hierarchy).
Hope this helps.
You are welcome. Does this measure work?
Revenue in first year of selection = calculate(SUM(Data[Total revenue),datesbetween(calendar[date],date([first selected year],1,1),date([first selected year],1,1)))
I have assumed that Total revenue is a column in the Data Table. First selected is a measure which i shared with you in my previous post.
Hope this helps.
What is the DAX to get the beginning of the year ? Please provide the same
Hi,
Does this measure work?
Minimum selected year = MIN('Calendar'[Year])
Thanks for your reply Ashish. This is not quite what I am looking for. The values that this gives me are these:
What I want is the beginning date column to return the minimum selected value of the slicer (which is 2016 in my case) across all the years.
Thanks
Hi,
Assuming Year has been dragged from the Calendar Table, try this measure
Minimum selected year = MINX(ALLSELETED(Calendar[Year]),Calendar[Year])
Hope this helps.
Thanks again Ashish! I tried this before and although it gives me the minimum year of the slicer, it doesn't give the selected minimum (in my case, I have the slicer range from 2000 to 2022 but I have selected it from 2016 to 2022 - and thus, I want the year to be the selected minimum).
Regards
Shashank
You are welcome. That is strange - the ALLSELECTED() function should have caught your selected years only.
Thanks Ashish. I have just created a new file trying to replicate this and get the same results unfortunately. Don't know what I am doing wrong. Anyway, thanks for taking the time to answer my queries. Appreciate it.
https://www.dropbox.com/s/ex851tvibrj76gd/Beginning%20Year%20Selected.pbix?dl=0
Hi,
To both visuals, drag the year column from the calendar Table (not from the Date hierarchy).
Hope this helps.
Perfect! thank you so much.
Just one follow up if I can - I am now trying to display the revenue that corresponds to the year 2016 across all the years to be used in a formula but can't get it to work. I am using the following formula:
However, this is the result that I get:
I want 40.74 (which is the revenue for year 2016) to be displayed across all years.
Thanks again!
You are welcome. Does this measure work?
Revenue in first year of selection = calculate(SUM(Data[Total revenue),datesbetween(calendar[date],date([first selected year],1,1),date([first selected year],1,1)))
I have assumed that Total revenue is a column in the Data Table. First selected is a measure which i shared with you in my previous post.
Hope this helps.
Yes it does!! Thank you so much 🙂
Have a great day
You are welcome.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |