Pass parameter to MDX/Tabular Object Model Cube using tableau parameter/filter - mdx

I have below things:
Tableau report (with Year and Month)
The tableau report is pointing to Tabular Object Model Cube
Tabular Object Model contains date dimension, region dimension and fact sales
Trying to achieve below:
When the user selects a year and a month from the report, the report should give me sales for previous 3 quarters with reference to the month selected
If your solution proposes to use a MDX query, then it would be great if you can point to some link, to illustrate how this can be done.
I have tried below:
Dragged Year and Quarter in rows(in tableau) and dragged the calculated field in column. This gives me sales across all quarters for all years but I want to limit this information to previous 3 quarters based on the Year and month selected by the user.

Related

SSAS Date Filter Issue

In my SSAS Model, I add Year Filer(2020) and YearMonth Filter(2021 Jan) same Time.
Then my measure data disappeared.
If I only add year filer then got the values.
Can't we add the year filters twice with different years

SSAS, how to make Dimension Attribute Month only show the months in current year?

In our date dimension, there are Month and Year attributes. Month attribute has set int month_year as key, to avoid duplicate problem, and Month attribute has name like January, February...
Now there is problem, if user drags Year and Month to filter, and would define one year, say 2017, he expect to see Month Attribute in filter only shows 12 month names in 2017. However, Month Attributes shows month names for all years, the names repeating many times.
There is already calendar hierarchy built in this dimension. But the user wants to define filter outside of hierarchy. How to build such Month Attribute in cube? Does some one have any idea about it? Thanks in advance!
The problem has been solved. Just add a new column in date table, say Month_in_current_Year, has the same content as Month column. Add this new column to date dimension as a new attribute. This new attribute works for my purpose. It shows only 12 elements as months in one year. And it slices correct value while setting it to filter. What magic is the cube!

Understanding the calculation in MDX

I would like to understand how the cube calculates values at different levels.
I have defined Calc as Calc = sum(Y over 12 months including current month)/sum(X over 12 months excluding current month)only for the month in the cube.
The values in month match the expected values when calculated manually. But I don't understand how the cube interprets this formula at the quarter and year level. I am not able to get the same values as in calc column when calculating manually.
Can someone explain me?Thanks.

Selecting columns based on date in Sharepoint

I am very new to Sharepoint. I am working on a resource utilization list in Sharepoint , which helps managers keep a tab on utilization of their resources for each month . My list therefore has 12 columns for each month of the year. I want to create a view where in only the future 5 months from the current month are displayed. Therefore for example if the current month is August, I want only August,September,October,November and December columns to be displayed and the other month columns hidden.

how to summarize sql result, week and month wise in single query

I want to summarize sql query result week wise and month wise at the same time in a grid view. Is this even possible or I am just dreaming?
Requirement:
Show last one month data and next two month's data week wise in the grid.
Example-
If the current month is September then I want to show data from 1st August to 31st October categorized in weeks.
Show the data after the next month of current month in month wise view in the same grid.
Example-
data for month November and December will be shown categorized in month not in weeks.
grid or result should look something like below -
Please suggest something to achieve this
If you want a maintainable solution, use two independent queries, one for weekly aggregation other for monthly. Depending on the input run corresponding query.
I think you must work with group by or group by ... cube
SELECT x , y from <tabel> GROUP BY date_feld( to_char( 'MM' ))
but i don't now your DBMS so i can't give you a exact example for the date handling.