Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

percentage problem giving wrong results

Hi All,

I am trying to achieve a simple problem but seems to be complex

Two points I am struggling with are
1. Use one single date to filter muliple data columns in different tables
2. To create yearly, monthly, weekly and daily percentage difference based on a dimension column (Ex Category)

We have multiple dimension tables and trying to create measure count(column) and its working fine individually.

also have multiple date columns and wanted to create a date table to filter different tables

Created a date table using calendar auto funtion (Dates[Date])

Is there a way to create a column or meausre to filter multiple date columns with single date.

because I cant join this date table to different dimension tables its showing inactive and only one active connection may be there is an indirect relationship between tables


For problem 1 I tried below but seems to not work when I add measures from tables its giving same result

Filter Date =
var MinDate = min(Dates[Date])
var MaxDate= max(Dates[Date])

RETURN
IF(OR(FIRSTDATE(Table1[Date]) > MaxDate, LASTDATE(Table1[Date]) < MinDate),0,1)

 

For problem 2 month percentage tried below also not working

MTD = CALCULATE(COUNT(Table[Name]),DATESMTD(Dates[Date]))
last MTD = CALCULATE(count(Table[Name]),DATESMTD(DATEADD(Dates[Date],-1,MONTH)))
diff% = DIVIDE([MTD]-[last MTD],[last MTD])

Also used parallel period function, previous month nothing wokred

 

Can someone please suggest. Thank you in advance

Anonymous 

 

2 Replies