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.
Hello All,
I've got a client dataset that includes non-standard date groupings, and they're expressed as ranges with StartDate and EndDate. It's 10+ years worth of data, so I'd rather not generate a row for each day if possible. Example table:
Period | StartDate | EndDate |
First | Jan 01, 01 | Feb 01, 01 |
Second | Feb 02, 01 | Mar 06, 01 |
Third | Mar 07, 01 | Aug 13, 01 |
Fourth | Aug 14, 01 | Jan 02, 02 |
Fifth | Jan 03, 02 | March 08, 02 |
Sixth | March 09, 02 | May 11, 02 |
What I'd like to be able to do is introduce a date slicer, so that if a person chooses a date within the described timeframe, it will only display that period. E.G. If a person selected August 16, 01 then they would be shown the Fourth period because it is between the start and end dates.
I'm really struggling to find a way to make that work. Is such a thing even possible, and if so will someone point me in the right direction?
Thanks a million!
Solved! Go to Solution.
As I mentioned in the initial question, a calendar table is not an acceptable solution for my client.
That said, I did figure it out myself. If anyone is looking to do something similar, you can use CALCULATE and FILTER([Date] >= [StartDate] && [Date] <= [EndDate]).
Thanks for all your help.
As I mentioned in the initial question, a calendar table is not an acceptable solution for my client.
That said, I did figure it out myself. If anyone is looking to do something similar, you can use CALCULATE and FILTER([Date] >= [StartDate] && [Date] <= [EndDate]).
Thanks for all your help.
Hi @DaveAl
As AlexisOlson and smpa01 recommended, you do need a calendar table, then you can create a measure to get the period.
If you need more help, you can @ me.
Is the above answer helpful? Could you accept the answer helpful as the solution? Thanks
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
A row per day (a calendar date dimension table) is the simplest solution. 10 years * 365 days/year is only a few thousand rows, which is tiny compared to what Power BI can handle. You typically want a calendar table for modeling purposes anyway.
@DaveAl the best way to deal with it, is to use a calendar table.
Bring axis (slicer, date values from-to) from calendar table. At the same time create a calculated colum in the calendar table that would assign the the "Period" classification from the above to table to there.
End users uses the values from calendar table and it would corrrectly slice the vize according to the Period (custom Period defined by you)
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |