At the moment I have a NSTableView with floating grouprows enabled. What I want to create are nested group rows. By nested I mean the following:
Month 1
week 1
day 1
day 2
week 2
day 1
day 2
Month 2
week 1
day 1
day 2
week 2
day 1
day 2
When you scroll though the view I want is that the Month group view stays at the top of the view until the next month comes along. Meanwhile the week group views stays under the month group view until the next week comes along. The day are normal cells that flow under the month and week group rows.
Have you tried the floatsGroupRows boolean? Read more about that at the Apple Developer page
Related
In a Report Builder table I have to show the value from the last day of the given month, when the month is not expanded.
When the month is expanded, the dates have to show the specific value for that day.
Example is January with values 1 to 31 (same as the day numbers):
When January is expanded, it has to show value 1 on Jan 1.... value 15 on Jan 15... value 31 on Jan 31.
When contracted (and the table only show one row for January), it should show the last day's value of 31
Some months do not have values on all days, so the formula just need to take the last value of that given month
When I use the formula "Last()", then it works half of the time, while for some months, the value extracted is the 3rd or 4th last day of the month - do you know what is wrong here?
Hope above makes sense, and thanks for help.
I think I fixed it my self:
Using Last () formula
Learning how to make a sort order in my Union All dataset, so it came out in the right way
How to give points to my self?
I'm fairly new to powerbi.
I want to be able to use a slicer to show the last week not the last 7 days.
I know you can use de relative week, but that shows the dates from Sunday to Monday.
I've also red that it's not possible to change the slicer settings for this.
Is it possible to archiev this in another way?
This is my date table https://imgur.com/a/dCcfBAZ
You can add a column that calculates last weeks' weeknumber and compares it to the weeknumber of the date in your row. Find the weeknumber for the current datetime (NOW), subtract 1, wrap that in an IF and you get a boolean to slice with:
LastWeek = IF((WEEKNUM(NOW(),2) - 1) = YourTableName[Weeknum],true,false)
Works the same as the relative week slicer option, but with the week starting on Monday.
All:
I wonder if there is easy way to group timestamp by order of week, for example:
A month usually has 5 or 4 weeks, once given a timestamp( something like UTC time 1483465353929 which is 1/3/2017 that should be put into 1st week group, say we use the first Monday of a month as the starting of the first week of that month, and if the timestamp is early than the first Monday like 1/1/2017, it should be put into previous month's last week group which is 5th week) How can I quickly identify its week order? Any implementation will be appreciated
Thanks
I have a table that has 2 values.
Value a phone was activated and a value when phone was deactivated.
I want to find out how many times that phone was still active on the last day of any given month.
Table1
phone1 DateActivated DateDeactivated HowManyTimesLastDayOfMonth
123 3/1/2016 3/15/2016 0
456 3/10/2016 6/25/2016 3
789 5/25/2016 10/10/2016 5
To amplify my comment:
SELECT phone1, DateActivated, DateDeactivated,
MONTHS_BETWEEN(FIRST_DAY(DateActivated+1), FIRST_DAY(DateDeactivated+1)) HowManyTimesLastDay
FROM mytable;
I should have explained better. The reason you take first_day(DateActivated+1) is that the second date (going to the first day of the next month) needs to be sure that it's not a full month - so if the phone was activated on March 1 and deactivated on March 25th, it doesn't show a full month. The reason for FIRST_DAY(DateDeactivated + 1) is to make sure that in the event that the deactivation occurred on the last day of a month that that counted towards the total.
I want to use Date.WeekOfYear() Function to get Week Number for datetime values, but with a custom day as the start of the week (Let's say Saturday rather than Sunday). How is it possible in PowerQuery M?
You could use a conditional statement like this (adding 1 to the weeknumber if the day is saturday):
if Date.DayOfWeek([Date])=5 then Date.WeekOfYear([Date])+1 else Date.WeekOfYear([Date])