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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply

Error with max and min dates in slicer

Hi, Guys
I created report and there have date slicer (between) from date table this table conncected with ather and have a lot of realatioships active and inactive). I want filter this slicer for example only from first day of this year and till today. Min date I set manualy from advence filter selected after 2020.12.31 date and for max I tried measure (if selectevalue(calendar'date')>today(),0,1) and put it on slicer filter(visual filter) and select 1. And both methods work bad because if I select last or first date 2021,01,01 or todays date my report craashed I mean visuals like just matrix table start make calculations for other periods not from 2021,01,01-today() and I get results like 2E+308 . Yeah I can create 1 day before and after min and max date but i guess there is better way to solve it?

6 REPLIES 6
v-janeyg-msft
Community Support
Community Support

Hi, @AndrejZevzikov 

 

According to your description, I made a simple sample. Yo can create a measure.

Like this:

Table = CALENDAR(DATE(2020,1,1),DATE(2021,12,31))
Measure = IF(SELECTEDVALUE('Table'[Date])>DATE(2020,12,31)&&SELECTEDVALUE('Table'[Date])<=TODAY(),1,0)

 

vjaneygmsft_0-1632737561960.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.


Best Regards,

Community Support Team _ Janey

Yeah, I make the same like you suggest, but problem is becouse my data range much bigger then one year. For excample I have data for year 2019 but in particular visualization I want see information only for year 2021, and when I select first date in slicer (2021.01.01) its start calculating previouse data for example year 2019 if i move slicer to 2021.01.02 its start work correctly. If I explaning to confusing can create simple example.

@AndrejZevzikov  Any updates?

Hi, @AndrejZevzikov 

 

This measure can also be used directly on a separate visual.

Or you can just let this slicer interact with a separate visual.

Change how visuals interact in a report - Power BI | Microsoft Docs

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.


Best Regards,

Community Support Team _ Janey

amitchandak
Super User
Super User

@AndrejZevzikov , the expected output is not clear

 

Try measure like

 

measure =
VAR _max = MAXX(allselected('calendar'),'calendar' [Date])
var _min = MinX(allselected('calendar'),'calendar' [Date])

return

if(_max >Today(),1,0)

 

 

or

 

 

measure =
VAR _max = MAXX(allselected('calendar'),'calendar' [Date])
var _min = MinX(allselected('calendar'),'calendar' [Date])

return

if(_min >Today(),1,0)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hm... dosen't work not even filter the slicer to today's day.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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