Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
I have an outage that starts in May, goes all though June, and ends in July
I need that outage to show up if I select May, June, OR July.
I report on many aspects of operations, open tickets, changes, outages, availability etc.
These are monthly reports, but i use a data table that allows any viewer to click a month, and see data for that month.
In particular I calculate the availability of services via outage records.
Duration is just datediff start end date
Solved! Go to Solution.
Thank you!
Using this as a guide, I created:
Hi @Yxalitis
Assuming you have a disconnected slicer table, that's possible.
You would retrieve your selected month from this disconnected table and then build your evaluation on top of it. Do you already have one? If so, your measure can be similar to this:
VAR _SelectMonth = SELECTEDVALUE(DISCONNECTED_SLICER[YearMonth])
VAR _Dates = CALCULATETABLE(YOUR_DATE_TABLE, EOMONTH(_SelectMonth, -1) + 1, MAX(YOUR_DATE_TABLE[Date]))
RETURN
CALCULATE( SUM(YOUR_VALUES_COLUMN[VALUE]), DATESBETWEEN(_Dates, MIN(YOUR_DATE_TABLE[Date]), MAX(YOUR_DATE_TABLE[Date])))
Of course, to better assist you, perhaps you may want to share some sample data, how your model looks, and expected results.
Thanks for your reply.
I am not sure what you mean by 'disconnected'
I have a date table that has relationships to multiple date files in multiple tables, but mostly these are inactive until I trigger with USERELATIONSHIP measures.
Here's a one-liner example:
Number | Start | End |
OUT0001234 | 1/05/2024 8:56 | 9/07/2024 |
I need that outage example above to show up if I select May or June or July in my global date slicer.
Every table and chart on the report uses this one date table, so I can’t simply make a new date table for this one measure, (or else I’d just build a separate measure that doesn't use my date table at all., the point is automation for end users to be able to select the date and see relevant data for that date, using one slicer, not one slicer for everything, and then another just for this table)
The goal is to select June in my one unified date table (that already filters dozens of graphs and tables simultaneously), and have that show me this above outage, where neither the start date nor end date are in June.
Hi @Yxalitis
I totally understand. What you have so far is definitely a best practice to use time intelligence based off your date table. The problem is that since you're selecting the dates in range, you're subject to the filter limitations that's being applied and as much as you would like to remove, they are considered persistent.
This is where a disconnected table comes into play. When referring to disconnected, it means there are no relationships to the table itself, this being "disconnected" from your model. These types of tables are used to display/retrieve user parameters. You'll understand this a bit more down the line in your BI journey.
If this is your first time seeing the terminology "disconnected", good news is that you'll be more familiar with it very very soon. Here's a sample of what a disconnected table looks like:
Then, most would retrieve the user's selection from the disconnected slicer table:
A sample result, selected Feb 2024 would return me all of February until end of my date range:
And all that's left for you to do is build your time intelligence against your date table:
Understanding and using disconnected tables will be an essential to building more robust, dynamic, and highly interactive reports.
Thanks again for you reply.
I can see what you are aiming at, but I don't think I've explained what i need clearly, my apologies.
I'll give you my full requirements.
I report on many aspects of operations, open tickets, changes, outages, availability etc.
These are monthly reports, but i use a data table that allows any viewer to click a month, and see data for that month.
In particular I calculate the availability of services via outage records.
Duration is just datediff start end date
I have this for B/H duration:
Hi @Yxalitis
Thank you for your explanation.
From what I can understand:
This isn't the end of the world and it can work granted that your date slicer is on the page itself and not on the filter pane. If that's the case, then all you would need to do add an ALL function to your calculation and it should work:
What this would do is to allow you to remove filter context applied at visual level and allow you to return values with a new date range.
Thanks very much for your ongoing attemtps to help me
This doesn't work at all
I have ONE ro for an outage, with Begin date in May, End date in July.
hi @Yxalitis
Sounds like you want to specifically set a start and end slicer. You can adjust your slicer to pick up both start and end dates like the image below:
And then you can find the min value, or in this case, your start date and the max value, or the maximum date.
Honestly, I'm getting more and more confused about the request. As you can tell, all my posts include images and relevant information that I feel would benefit you to understand my answers. It would be very helpful for myself and the community if you could upload a non-confidential version of your model, explain in greater detail your inputs and expected outputs in a table-like structure.
If you cannot upload a model, please explain in a manner (with supporting images) that is easy to digest for us to be better equipped in assisting you.
Apologies, I'll try again.
I have one date table It has a slicer on the page I use to select the month of interest.
I have a measure to determine total number of hours in the month [TOTAL HOURS]
I have one Outage table.
Each outage is one row, that has Begin and End date
Duration is DATEDIFF(Begin,End,HOUR)
I associate End date to the date table
I use this measure to calculate availability:
However, sometimes an outage starts in one month, and ends in another.
e.g.
Number | Begin | End | Duration |
OUT0003016 | 1/05/2024 8:56:00 AM | 9/07/2024 1:00:00 PM | 1660.1 |
CURRENT SITUATION
If I select May or June in my date slicer, this Outage will not show up
If I select July I get the entire duration of 1660.
DESIRED OUTCOME
If i select May, I get the duration based on Begin => 31/05/2024 23:59:59 (i.e. MAX or FINALDATE(Date)
If I select June I get the duration based on 01/06/2024 0:00 => 30/06/2024 23:59:59
If I select July I get the duration based on 01/06/2024 0:00 => End
That means I need intelligence to determine that:
The outage is active within the selected month., whole or partially, so it is selected with the Date Table slicer
If the Begin date is earlier than the current month, use the beginning of the selected month as start date
If the End date is later than the current month, use the end of the selected month as end date
To then calculate duration based on the above.
There is no value to sum, I need to CALCUALTE the duratin based on DATEDIFF, determined form the above requirements.
Hi @Yxalitis ,
Please take a look at this and see if this meets your criteria. I have built out a sample to help both myself and you understand.
I start off with a Date table that I'm using to slice my data connected to a table caled OUTAGE:
A slicer visual is added to the page returning the values of the month of a calendar. The sample data with result:
My measure used to achieve your desired result:
so... based on your expected output using my sample data, if I select May I should return both outages that has the month of May. Additionally, if the end dates is greater than the current month, then use the max date of the current selected month.
If I select June, I should also get all June records. Additionally, if the begin dates is less than the current month, then use the min date of the current selected month.
Finally, the duration is the difference between the two dates in evaluation via DATEDIFF function:
Thank you!
Using this as a guide, I created: