Forum Discussion
Need help converting calculate column to Measure
- 4 years ago
I still cannot make heads or tails out of the original calculated column DAX with the syntax errors. If you want to use the date from a date table use RELATED('Date'[Date]) instead of the order date.
Otherwise read EVERYTHING I wrote in my first post and provide all of that.
Virtually impossible without more info dakins
- Your DAX isn't correct. If I copy and paste it into DAXFORMATTER.com there are a lot of syntax errors, so I cannot see what it is doing.
- I don't know where or how you are using it. Calculated columns only have row context. Measures have Filter Context, and may or may not create row context depending on the functions used (SUMX, FILTER and more create row context)
- We have no data to test with.
It will likely involve replacing some column references with SELECTEDVALUE() on some fields but again, without knowing how it is being used, that may not work. SELECTEDVALUE() can return a value, a blank, or an alternate value depending on the visual it is in (matrix for example) and that can change as the user moves through a heirarchy in the matrix.
How to get good help fast. Help us help you.
How To Ask A Technical Question If you Really Want An Answer
How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.
edhans- Thanks for trying to help. The code I have above is for a calculated column I created with the order date in my product table. Now I am learning to use calendar table hence my order date is useless. I want to re-create the calculated column I once had as a measure.
I hope this provides context
P.s - I have a calendar table now hence the order date in the product table is useless
Below is my Product Table
| Name | Order Date | Status | Color |
| Iphone S | 03/02/2021 | Unknown | Black |
| Iphone X | 10/02/2021 | White | |
| Iphone R | 01/09/2022 | New | Gold |
| Iphone P | 10/1/2019 | Used | Black |