Forum Discussion
midrississi
5 years agoFrequent Visitor
Calculated column based on formula, filter, month and year - using slicer
Hello everybody, I'd like to ask you for help with a calculated column, I'll use the following table to demostrate it on an example, Table In order to get the Requested column NEW_P...
- 5 years ago
Try this. If it doesn't work I'd need the pbix to run some tests (or a pbix with dummy data that repros the issues)
New price = VAR lastMonth_ = CALCULATE ( MAX ( 'Table'[NO_MONTH] ), ALLSELECTED(), SUMMARIZE('Table','Table'[ID_ITEM],'Table'[NO_YEAR] ) ) VAR priceMoisAnnee_ = CALCULATE ( MAX ('Table'[PRICE]), 'Table'[NO_MONTH] = lastMonth_, ALLSELECTED(), SUMMARIZE('Table','Table'[ID_ITEM],'Table'[NO_YEAR] ) ) RETURN priceMoisAnnee_Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
midrississi
5 years agoFrequent Visitor
AlB ,
Thank you for finding the URL to download the .pbix project.
URL : http://s000.tinyupload.com/?file_id=00669915136941173932
Thank you in advance for your help.
Best regards,
midrississi
5 years agoFrequent Visitor
AlB
It's okay I found where the problem comes from.
Instead of using the "DT_DATE" field which is in the fact table to filter in the slicer, I used the one which is in the Date dimension table and it worked.
Thanks for your help.
Best regards