Forum Discussion
Dynamic calculations basis Date selection
- 5 years ago
Hi, Anonymous
It’s my pleasure to answer for you.
According to your description, I think you can create a calendar table to filter date, then create three similar measures,put them in 100% stacked bar chart.
Like this:
1-30 = SUMX ( FILTER ( ADDCOLUMNS ( 'Table', "age", VAR selecteddate = SELECTEDVALUE ( 'Table 2'[Date] ) VAR duedate = IF ( [Due Date] = BLANK (), TODAY (), [Due Date] ) RETURN SWITCH ( TRUE (), duedate - selecteddate > 30, "31-60", duedate - selecteddate >= 0 && duedate - selecteddate < 30, "1-30", duedate - selecteddate < 0, "Current", BLANK () ) ), [age] = "1-30" ), [Net Amount] )Here is my sample .pbix file.Hope it helps.
If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous , where is Due Date ?
You can have a measure like this keep the smaller date before
Days = datediff(Selectedvalue(Date[Date]), max(Table[Due Date]), day)
Need a context to sum or Avg
Sumx(values(Table[Customter]),[Days])
For bucket refer my video on dynamic segmentation : https://www.youtube.com/watch?v=CuczXPj0N-k
- Anonymous5 years agoNot applicable
Sorry my bad, mentioned the wrong dataset
- v-janeyg-msft5 years agoCommunity Support
Hi, Anonymous
It’s my pleasure to answer for you.
According to your description, I think you can create a calendar table to filter date, then create three similar measures,put them in 100% stacked bar chart.
Like this:
1-30 = SUMX ( FILTER ( ADDCOLUMNS ( 'Table', "age", VAR selecteddate = SELECTEDVALUE ( 'Table 2'[Date] ) VAR duedate = IF ( [Due Date] = BLANK (), TODAY (), [Due Date] ) RETURN SWITCH ( TRUE (), duedate - selecteddate > 30, "31-60", duedate - selecteddate >= 0 && duedate - selecteddate < 30, "1-30", duedate - selecteddate < 0, "Current", BLANK () ) ), [age] = "1-30" ), [Net Amount] )Here is my sample .pbix file.Hope it helps.
If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.