How to filter by grouped dates when using date type data from a SSAS Cube in Excel - excel

I have a published SSAS cube with multiple facts, dimensions, and a date table. We have end users that would like to filter some of the data by different dates that are on the dimensions (service date, bill date, etc.). In the SSAS model, all of the columns containing those dates have a short date data type. However, when I pull those columns into a pivot table in an excel document, the dates are not grouped and you have to select each day one at a time.
I tried to change up the date format, but no matter what I do it does not group the date columns when getting data from the SSAS cube.
Here is a screenshot of the data type in SSAS:
Here is a screenshot of the filter:
This is what I am trying to get to:

You have to create a hierarchy containing attributes Year, Month, and Day.
In my cube it looks like this:

Related

Date table in SSAS Tabular model not working

I built an SSAS Tabular model cube and created a date table using calendarauto(). I have marked it as a date table and created a relationship with the fact table using the date column, and both columns have a Datetime data type.
When I analyze the data using excel, the date filter is not working correctly. For example, when I filter on the year 2021, it gives me row values for the year 2019 also, but if I use the date column from the fact table, I get the correct results.
When I analyze the Tabular cube using Power BI, it works right.
Could you please suggest what exactly is going wrong with our date table?
When I put the Fact table date column and date table date column on excel it looks like the screenshot below.
First, I think that is a bad IDEA to use CALENDARAUTO because it searching for all date columns from your model (and if you have a Customer with a born date eg. 1912-02-02, then you create a big table from that date).
CALENDARAUTO ignores calculated tables and calculated columns
searching for date columns. Only the imported columns are analyzed to
search for date columns.
Internally, CALENDARAUTO calls CALENDAR providing a date range that
include all the days in the range of years referenced by data in the
model, according to the following rules:
The earliest date in the model which is not in a calculated column or
calculated table is taken as the MinDate. The latest date in the model
which is not in a calculated column or calculated table is taken as
the MaxDate. The date range returned is dates between the beginning of
the fiscal year associated with MinDate and the end of the fiscal year
associated with MaxDate.
A better idea is to use CALENDAR where you have more control
CALENDAR (
DATE ( 2005, 1, 1 ),
DATE ( 2015, 12, 31 )
)
To the topic. Are you sure that you make a relationship on THIS column (in your fact table)? Check also Cross Filtering Behavior -> OnDirection/BothDirection; Show your relationship detail.

Pivot Chart - 3 date columns, how to show counts of the dates by month?

My goal is to have a count of three different dates by month in a bar chart. Currently we are using a count if formula then building the chart above that, would like a cleaner solution. I have three columns, Open, Action, and closed dates. Adding all three to the axis doesn't produce the right results. I'm stuck. Is there something in the pivot that I can change? I'm pulling the data in via Power Query, is there something there I can change? Many thanks :-)
Ideal state
Recent Action and Closed dates are not show up, that seems to be the real issue. Why and how to fix it?
Sample of data
Created a date table in Power Query.
Also in Power query, duped my data then deleted all but the columns I didn't need.
Unpivoted the three date columns.
Joined the new date to the date table.
Graphs fine.

Generate a forecast on a Running Sum chart in Tableau

I need to create a forecast chart of a Running Sum of a column in my data. The data comes from and Excel table and is an income value. I have a line chart of the Running Sum of this income over time (year quarters). The data itself is not ordered by date, but by a particular ID that is not used in this chart, and it should not be re-ordered.
The chart looks like this:
If I just use the income, I can create the chart with a forecast. However, if I add the quick calculation for Running Sum, then the forecast stops working because "Forecast can't be added to a view that uses a table calculation".
I tried creating a calculated field that already contains the Running Sum, but Tableau recognizes it as a table calculation too. I also tried creating the Running Sum in the original data (I have access to the Excel file) but since the rows are not ordered by date, the Running Sum doesn't work.
I would like to know if there is an alternative? It can be either using a Tableau workaround or an Excel calculation I am not aware of, that gives me this Running Sum without Tableau identifying it as one.
Thanks in advance.
In the end, I managed to created a Running Rum in the Excel using the following formula:
=SUMIFS(DATABANK!T:T,DATABANK!O:O,CONCAT("<",TEXT(A2,"0")),DATABANK!D:D,"ELC")
Where in column A I have one month date per row, DATABANK-T is the Income, DATABANK-O is the Date and DATABANK-D is a filter (not relevant to the problem).
Then, in Tableau I took the Date as a column (by months) and this Running Sum as a measure, as a SUM.

Problem with SSAS ParallelPeriod and Excel 2013 Timeline Filter

Currently i had a project using Microsoft SQL Server Analysis Service. I found a problem regarding filtering data with excel timeline.
Here is my date dimension screenshot:
<img src="https://i.stack.imgur.com/NUr2x.png"/><img src="https://i.stack.imgur.com/5OSgA.png" />
I had a cube with 2 measures, Sales Quantity (measures) and Sales Quantity Last Year (calculation). Here is MDX expression for Sales Quantity Last Year calculation:
( ParallelPeriod([Date].[YM].[Calendar Year],1,[Date].[YM].CurrentMember),[Measures].[Sales Quantity In 1000] )
After deploying the project to my local server, the data can be shown perfectly using excel 2013:
Pic: Data in Excel without filter
The problem start when i want to filter the data using excel timeline. When i filter only '2016', my calculation measure is no longer working. You can see the data in 'Sales Quantity in 1000 LY' column is blank. It looks like that i cant see the data outside current filter (2016). Pic: Filtered using timeline filter
But when i use slicer, the data can be shown normally Pic:Filtered using Slicer
Did i make a mistake in building date dimension? Or i need to fix the MDX calculation query? Because when i test this case in Microsoft AdventureWorksDW2014 with the same date hierarchy and the same calculation, all is going well.
Your parallel period calculation looks correct assuming [Date].[YM] is your date hierarchy. I am guessing that your date dimension is off somehow.
Make sure that:
it has a hierarchy created, and the hierarchy is what you are referencing in the parallel period calculation. Here is an example, you could have more or less attributes in the hierarchy obviously.
Your attribute relationships are defined correctly.
Key columns on the attributes in the hierarchy are correct. In the example above, you would just make year the key for the year column, but then for quarter it would be a collection of the year and quarter column. For period, key columns would be year, quarter, period. For week, key columns would be year, quarter, period, week. Date would just use the date column since date is the key.
4.Make sure that the date key attribute is using a date field for it's value column, as a time slicer needs this.
define time intelligence on your date dimension. Right click on the date dimension on the solution explorer and choose add business intelligence, then on choose enhancement screen pick define dimension intelligence. Then set the attribute type for each dimension attribute. Here is how it would be for our example.
Hopefully one of these does it for you.

query in a powerpivot table to do a group by

I have a table called "purchase" with the following data:
year month time day_week name provider service purchase revenue
I am using this data to make a pivot table. Then I have another table called "active":
name provider service description month year number_active
I used this data to create a separate pivot table.
Now I need a third pivot table with something like:
number_active/revenue
and slice it vertically to by year. The problem is that I cannot create a relationship between the table because in Purchase I have the services by day and hour and in Active I have the services by month. I think I need to create another table that is a view of Purchase grouped by month.
I tried the following :
home -> From Database -> From analysis services or PowerPivot
But i have a error:
I'm not sure where to go from here.
How can I make this view grouped by month?
I don't think you need to create a new view of summarized data as a source. You just need to be able to summarize by date, and you can do this by adding a date dimension.
You can download one for free from the Windows Azure marketplace.
Once you have your date table, add a calculated column to the Active table in your Power Pivot model called Date that is =[Month]&"/01/"&[year]. Then change the data type to date.
Then do the same thing to your Purchase table. Next, create relationships from Active[Date] to Date[DateKey] and from Purchase[Date] to Date[DateKey].
You could make all of this go down to the time level and related it there instead (Power Pivot will assume midnight if you don't specify a time in your date column). But I'm simplifying since that is not needed for this one scenario.
Next make your two base calculated measures
Number Active:=Sum(Active[number_active])
Total Revenue:=Sum(Purchase[revenue])
I'm not sure what your number active means, so I'm assuming it is just a sum. You can adjust this calc if this is not the case.
Then make your final calculation: Revenue Per Active User:= [Number Active]/[Total Revenue]
Then you should be able to pull month and year into a pivot table along with this new calculated measure and your original measures (number active and revenue).

Resources