Forum Discussion
Cannot separate columns!
- 6 years ago
Hi, Anonymous
Based on your desciption, I created data to reproduce your scenario.
Table:
You may create a calculated table and create a one-to-one relationship between two tables as follows.
DateTable = CALENDARAUTO()Then you may create a calculated column in 'Table' as below.
Lastyearvalue = CALCULATE( SUM('Table'[CurrentYeatValue]), SAMEPERIODLASTYEAR(DateTable[Date]) )Then you may create a table by 'Enter Date' as the screenshot.
Table abr:
Finally you can create a measure as follows and put it in the 'Values' area of the matrix visual.
Value = var _abr = SELECTEDVALUE('Table abr'[abr]) return IF( _abr = "currentyear", MAX('Table'[CurrentYeatValue]), IF( _abr = "lastyear", MAX('Table'[Lastyearvalue]), BLANK() ) )Result:
If I misunderstand your thought, please show me your smaple data and expected result. Do mask sensitive data before uploading. Thanks.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Anonymous
Based on your desciption, I created data to reproduce your scenario.
Table:
You may create a calculated table and create a one-to-one relationship between two tables as follows.
DateTable = CALENDARAUTO()
Then you may create a calculated column in 'Table' as below.
Lastyearvalue =
CALCULATE(
SUM('Table'[CurrentYeatValue]),
SAMEPERIODLASTYEAR(DateTable[Date])
)
Then you may create a table by 'Enter Date' as the screenshot.
Table abr:
Finally you can create a measure as follows and put it in the 'Values' area of the matrix visual.
Value =
var _abr = SELECTEDVALUE('Table abr'[abr])
return
IF(
_abr = "currentyear",
MAX('Table'[CurrentYeatValue]),
IF(
_abr = "lastyear",
MAX('Table'[Lastyearvalue]),
BLANK()
)
)
Result:
If I misunderstand your thought, please show me your smaple data and expected result. Do mask sensitive data before uploading. Thanks.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Allan!
Thank you so much for your help, this solution worked perfectly! π
Thank you for your time! Have a great day!
Best regards,
SΓlvia