Forum Discussion
Anonymous
5 years agoNot applicable
Dynamic calculations basis Date selection
Objective:- Dynamic calculations basis Date selection Requirement :- Categorise all transactions basis difference between selected date and Due Date of Transaction into different buckets as below...
- 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.
themistoklis
5 years agoCommunity Champion
Anonymous
In a new column add the following formula to create the groups.
Then on the chart add the column and the net amount
Column =
var _selecteddate = SELECTEDVALUE('Calendar'[Date])
return
SWITCH (
TRUE (),
'Table'[Due_date] - _selecteddate > 30, "31-60",
'Table'[Due_date] - _selecteddate >= 0 && 'Table'[Due_date] - _selecteddate < 30 , "0-30",
'Table'[Due_date] - _selecteddate < 0, "Current",
BLANK()
)