Forum Discussion
Line graph 6 months backward based on Dropdown selection
- 2 years ago
Hi,
You may refer to my solution in the attached PBI file.
Hope this helps.
- 2 years ago
pls ignore i manage to find a solution
i created another measure
Inbound =VAR __END_DATE_WEEK =MAXX(ALLSELECTED('Dates(Disconnected)W'),'Dates(Disconnected)W'[End of Week])VAR __END_DATE_MONTH =MAXX(ALLSELECTED('Dates(Disconnected)M'),'Dates(Disconnected)M'[End of Month])RETURNIF(ISFILTERED('Dates(Disconnected)W'[End of Week]),CALCULATE(DISTINCTCOUNT(RECEIPT_CONTAINER[CONTAINER_ID]),FILTER(RECEIPT_CONTAINER,RECEIPT_CONTAINER[End of Week] = __END_DATE_WEEK)),IF(ISFILTERED('Dates(Disconnected)M'[End of Month]),CALCULATE(DISTINCTCOUNT(RECEIPT_CONTAINER[CONTAINER_ID]),FILTER(RECEIPT_CONTAINER,RECEIPT_CONTAINER[End of Month] = __END_DATE_MONTH)),DISTINCTCOUNT(RECEIPT_CONTAINER[CONTAINER_ID])))
danextian i replicated your formula for End of week
EDATE function is for adding to or subracting x months from a date. The variable below is equivalent to selected date - 6 months.
VAR __START_DATE =
EDATE ( __END_DATE, - 6 )
Use this instead
VAR __START_DATE =
__END_DATE - ( 6 * 7 )
- vinodDrinkPak2 years agoHelper II
danextian thanks for the response
it doesn't work still, see below, i have used this dax
Inbound Week =VAR __END_DATE =MAX ( 'Dates(Disconnected)W'[End of Week])VAR __START_DATE =EDATE ( __END_DATE, - 6*7 )RETURNCALCULATE (DISTINCTCOUNT ( RECEIPT_CONTAINER[CONTAINER_ID] ),FILTER (RECEIPT_CONTAINER,RECEIPT_CONTAINER[End of Week] >= __START_DATE&& RECEIPT_CONTAINER[End of Week] <= __END_DATE))could you please take a look at it, when you get sometime, there is another problem to the measure we are using, i think it doesn't interal with my graphs and cards, pls check- danextian2 years agoSuper User
Hi vinodDrinkPak ,
This was my suggestion as the variable:
VAR __START_DATE = __END_DATE - ( 6 * 7 )but you wrote:
VAR __START_DATE = EDATE ( __END_DATE, - 6*7 )- vinodDrinkPak2 years agoHelper II
danextian i think this formulas are not interacting with my cards and other visuals? do i need to make some tweak, i am aware the slicer you have used is coming from disconnected table
earliers it was from the Receipt container tables and was working with all visuals, now given that we have brought in disconnected tables, i am not able to interact with other visuals, as its only interacting with Line graphs
any solution you could share?