I need to find out the number of days in Month based on Time dimension. Time dimension is Month when Jan is selected it has to return 31 as value.
Asked
Active
Viewed 38 times
0
-
you must add your current query to the question, even if it is incomplete. This shows you have done some effort. – MoazRub Feb 20 '19 at 11:34
-
This is what I tried Datediff("d",[PostingMonth].[PostingMonth].CURRENTMEMBER.lag(3),[PostingMonth].[PostingMonth].CURRENTMEMBER.lag(0)) – SKenneth Feb 20 '19 at 11:39
2 Answers
0
The below sample shows how to get the count. Please note the below query only show the idea how to do this. Your cube will note have these attributes you you need to replace them
with member measures.t as Count(([Date].[Month of Year].&[1],[Date].[Day of Month].[Day of Month].members)) select {measures.t} on columns from [Adventure Works]

MoazRub
- 2,881
- 2
- 10
- 20
-
-
Skenneth can you share the complete query? Are you using some UI like excel or powerbi or are you writing the query on management studio – MoazRub Feb 20 '19 at 18:30
0
If you have Time dimension and Time hierarchy, this should work:
WITH MEMBER measures.NumOfDays AS
Count
(
Descendants
(
[Time].[Time].CurrentMember,
,LEAVES
)
)
SELECT Measures.NumOfDays ON 0,
[Time].[Time].Month on 1
FROM [MyCube]

vldmrrdjcc
- 2,082
- 5
- 22
- 41