The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
im trying to create a calculated Column which combines two columns to create a composite key, so i can use relations in my model.
I am using Apache Spark direct query mode to connect to Databricks data.
I have found some previous posts about this issue but they were all pretty old and none of the recommended Workarounds worked for me.
My Current Attempt is this:
Hi,
As per our understanding, you want a Calculated Column in Power BI which include combined value from Unique ID and Timestamp column.
We can see in your Given Data the Date/Time is in 24.01.2023 00:06:28
which contains the " . " instead of the / but the Date Time Format in Power BI do not include any of the format using “.”
So, you need to first convert the current data into correct format by creating a new Calculated column for the Timestamp with Following Dax Expression:
New TimeStamps = SUBSTITUTE('Sample Table'[TIme Stamp],".","/")
Then Create the Desired Column CompositeKey Using the Below Dax Expression,
CompositeKey = COMBINEVALUES("-",'Sample Table'[Unique ID],FORMAT('Sample
Table'[New TimeStamps],"m/d/yy hh:nn:ss"))
This will result in combined values as shown in the below screenshot,
If this answer helps, please mark it as Accepted Solution so it would help others to find the solution.
Thanks!
Inogic Professional Service Division
An expert technical extension for your techno-functional business needs
Power Platform/Dynamics 365 CRM
Drop an email at crm@inogic.com
Service: http://www.inogic.com/services/
Power Platform/Dynamics 365 CRM Tips and Tricks: http://www.inogic.com/blog/
Hi,
Thanks for your answer, however the SUBSTITUTE Function is not available in direct query mode:
I dont believe this was the issue anyways, i think the "." instead of "/" is simply displayed this way because its the German standard, the column datetype is Date/Time in the model Tab:
I know its not easily possible to test with direct query mode but my issue is not reproducable in import mode.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.