Forum Discussion
Calculated column based on formula, filter, month and year - using slicer
- 6 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
AlB ,
The same thing the code gives the good result before filter but after filter I don't have what I want.
How I can share with you the .pbix project ?
Thank you in advance.
Best regards,
You have to share here the URL to the file hosted elsewhere: Dropbox, Onedrive... or just upload the file to a site like tinyupload.com (no sign-up required).
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
- midrississi6 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,
- midrississi6 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