Adding a Breakdown Dimension to a Pivot table on Google Data Studio - pivot-table

I am using a pivot table on Google Data Studio, which shows total income for each month of the year.
I wish to show total income for each month of the year, separated by years - for example, January 2017, and January 2018 will hopefully appear one above the other.
I attached an example that describes best what I need (couldn't find an explanation for how its built in the picture)
In the picture, the equivalent for "Years" is "Gender"

Figured it out. its just by adding another metric in the row dimension, missed it on the first try..

Related

How to get a YTM calculation instead of YTD in Google Data Studio

I have an earnings table in my Google Data Studio report from January 21 - YTD.
But what i want is a table that shows me YTM (so this year until last month) Jan-21 til Sep-21 and that dynamicly on 1st Nov, Okt-21 is added to the table, and on 1st dec Nov-21
is added etc.
Because the Total YTD value is other wise too high, due to cost being booked at the end of the month and earnings through the month.
Filters wont let you do it dynamicly,
date range filters same,
always possible to do it manualy with date range but this i cannot ask from my client.
any suggestions??
Kind regards
I found the answer,
i left the question for when someone else wants to do it,
it is actualy simpel fixed by using advanced date filter and then leaving the start date on 1-jan, and end date to today minus 1 month.
this gave me the exact result i needed yt last month

Power BI: Week #'s not sorting properly

I am having trouble with a line graph visual, where the data is organized by week number and by year number. However when I put the information into the visual and try viewing both 2020 & 2021, it rearranges the data in the order of 2021 & 2020. How do i get it to properly see the data in the correct order of week number by year?
I tried sorting the week # by an index value, also by year, also by week... with no luck
From the images it looks like there is no sort on the year and week, just by the week.
You need to add a column that has a year week key, that you can sort by.
For example 202101 for the week one of 2021.
Assuming you have a date like dd/mm/yyyy format, for example 11/04/2021 in DAX you can use:
YearWeek = YEAR('Table'[Date]) & WEEKNUM('Table'[Date])
This should now sort the data correctly. If you want you can add another column, that is more user friendly like WK01-2021, if you wish, you can then sort by that column, or use the new key column to sort the textual one.
If you just have a year and week column, create a new column that concatenates the two.
For this you should have a Calendar table, that contains a the date groupings that you you need. For example using CALENDARAUTO or you can do it in Power Query here or here.
This actually does not give the correct sequence, when you are dealing with single digit week numbers. For example when dealing with the first ten weeks of 2020, the sequence would be 20201, 202010,20202, 20203... which is obviously wrong.
Here you need a double digit Week number, so a small change in the suggested formula should do it:
YearWeek = YEAR('Table'[Date]) & FORMAT(WEEKNUM('Table'[Date]),"00")
The sequence should now work.

Data Studio - Grouping by Week

I have a simple Data Studio table consisting of two columns. The first column is the week (ISO Year Week) and the second column is the total registrations we've received for that week.
However, my Week column repeats 7 times (7 Rows) for each week as it's counting by day within that week. See below:
Is there any way to get this to group by the listed week? Below are my settings:
Dimension = Conversion Date set as "ISO Year Week" for the type.
Metric = Equals the count of Conversion Date (Same Conversion Date field used for dimension)
Any help would be much appreciated.
There might be an issue with the date format of the source. Without knowing the source (e.g. Google Analytics or Sheets) it’s hard to tell.
Blended Data
I recently had this issue with blended data. The response of a similar question helped me to find a way.
Basically you have to add a new custom field to the data source with the formula WEEK(date_field_link). Data studio will recognise this as a date in compatibility mode, but for me it still works. Then you can use this new date field as a join key to blend the data while grouping it in weeks.
Normal Data
If this problem appears in a regular non-blended dataset you might want to check if Data Studio correctly catches the date as a date. This help article from Google might be worth checking out: https://support.google.com/datastudio/answer/6401549?hl=en#zippy=%2Cin-this-article
I made a similar case work using blended data.
Your column "Conversion Date" repeats the same week 7 times because it's just a display value. Every row has a date value (year, month and a day) but you're just showing the corresponding week. So, data-studio treats them as different data and doesn't group them.
To be able to group them by Week you need to create a new field with a value containing only the week and the year. So, you can use the formula
YEARWEEK(your_date)
The resulting Date will be groupable.
NB1: If your date isn't of the type Date, you can parse it from text to date using
the method:
PARSE_DATE("%Y-%m-%d", your_date_text)
NB2: If the created field has the type number and doesn't show the possibility to change type to Date, you can do this trick: (it's weird but it works):
First type as a formula for the created field and apply:
MONTH(your_date)
This will unlock the compatibility Date types. You can choose from them the ISO Year Week type.
and then change the formula from MONTH(your_date) to YEARWEEK(your_date) [your formula] as I explained above. The chosen date type won't go away even if it wasn't available the first time.

Create a column within an SSRS Report to sum values based on conditions of previous column

I have an ssrs report that shows revenues for each month of a year for several years based on start and end date parameters the user enters. What I would like to do is add a second column that shows the revenue for that quarter (march would show q1 revenue, june q2 etc). the problem I am having is that I am able to do this for a single year but once the query starts looking at multiple years my column shows the value for all 1st quarters regardless of year. The picture shows what I am currently getting. Any recommendations on how to fix my expression to also look at the year value when summing these quarters?
Here is the code I am using to only populate the quarter column based on the month.
=IIF(Fields!Sort_Order.Value=3,
Sum(Lookup(1,Fields!Sort_Order.Value,Fields!Calculated_Revenue.Value,"Bookings"))
+Sum(Lookup(2,Fields!Sort_Order.Value,Fields!Calculated_Revenue.Value,"Bookings"))
+Sum(Lookup(3,Fields!Sort_Order.Value,Fields!Calculated_Revenue.Value,"Bookings")),
IIF(Fields!Sort_Order.Value=6,
Sum(Lookup(4,Fields!Sort_Order.Value,Fields!Calculated_Revenue.Value,"Bookings"))
+Sum(Lookup(5,Fields!Sort_Order.Value,Fields!Calculated_Revenue.Value,"Bookings"))
+Sum(Lookup(6,Fields!Sort_Order.Value,Fields!Calculated_Revenue.Value,"Bookings")),
IIF(Fields!Sort_Order.Value=9,
Sum(Lookup(7,Fields!Sort_Order.Value,Fields!Calculated_Revenue.Value,"Bookings"))
+Sum(Lookup(8,Fields!Sort_Order.Value,Fields!Calculated_Revenue.Value,"Bookings"))
+Sum(Lookup(9,Fields!Sort_Order.Value,Fields!Calculated_Revenue.Value,"Bookings")),
IIF(Fields!Sort_Order.Value=12,
Sum(Lookup(10,Fields!Sort_Order.Value,Fields!Calculated_Revenue.Value,"Bookings"))
+Sum(Lookup(11,Fields!Sort_Order.Value,Fields!Calculated_Revenue.Value,"Bookings"))
+Sum(Lookup(12,Fields!Sort_Order.Value,Fields!Calculated_Revenue.Value,"Bookings")),""))))
I ended up creating a quarter column within my data set that was then used as a parent group for the month rows. I then hid that column and added a total for the quarter that gave me sub totals. Not exactly what I was looking for but gave me the result I needed.

SSRS Math across matrix

I have created a matrix with the groupings below in SSRS 2008 R2 and SQL Server 2008 R2.
MembershipStatus has "New Enroll", "Term", "Active".
What I need to do is to add a row called "Other" to do the following calculation:
Last month new enroll + last month active – this month term – this month active
In the example below, it's
19,281 + 0 - 2,082 - 17,195 = 4
I've used temp tables and various combinations of APPLY to get the results I need in SQL, but due to the large number of parameter combinations, I really need to do it inside SSRS.
Should I just give up and code it in the CODE section of the report?
Any insight would be greatly appreciated.
Try using the ReportItems function. Each text box in SSRS will have unique name which can be found by selecting the respective text box and then checking the top most section in the properties window displayed on the right side.
Let's say your NEW ENROLL value for June is displayed in Textbox1, TERM FOR June in Textbox2, ACTIVE for June in Textbox3, NEW ENROLL FOR July in Textbox4, TERM for July in Textbox5, ACTIVE FOR July in Textbox6 and so on. Write the below expression for OTHER value for July as below:
=ReportItems!Textbox1.Value + ReportItems!Textbox3.Value - ReportItems!Textbox5.Value - ReportItems!Textbox6.Value
This formula will change based on the default naming by SSRS for the respective textboxes.
With the calculation provided, it only allows to do the calculation in the same month. The question is how to calculate numbers in the previous month against current month...
how could it be done?

Resources