The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
HI Friends,
I have an easy task to solve but can't able to do it. I have a table with ID, col1, col2, col3 and I want to create a calucated column ( not measure) that gets max date of col1, col2, col3. I can achive the expected result by creating measure using below formula but as I said I want to create a column. I used Max funciton but it doesn't work. Could you please help me figure it out? Thank you in advance!
MaxDate =
MAXX(
{
MAX(table[Col1]),
MAX(table[Col2]),
MAX(table[Col3])
},
[Value]
)
HI @Patv,
AFAIK, power bi has limited the calculated column Dax functions usage when you are working with 'direct query' mode. So I think you need to use measure expression instead.
Regards,
Xiaoxin Sheng
Hi @Patv
Try this code to find the MAX date and create a calculated column:
Max Date = max(MAX('Table'[Col1],'Table'[Col2]),'Table'[Col3])
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi VahidDM,
Thank you for replying. This solution works if I have a Storage Mode = "Import". Currenlty, I have a Storage Mode = DirectQuery and when I apply below formula, I get an error ORA-00932: inconsistent Datatypes: expected DATE got NUMBER. The exception was raised by the IDbCommand Intercace. ( attached sceen below). In my table, All the date columns have datatype = Date and ID has datatype = Number. Would you please help me how to solve it?
Max Date = max(MAX('Table'[Col1],'Table'[Col2]),'Table'[Col3])
User | Count |
---|---|
65 | |
61 | |
60 | |
53 | |
30 |
User | Count |
---|---|
180 | |
88 | |
71 | |
48 | |
46 |