I need to wait for the data to refresh, which is over 6.5M rows.
I need to step away and come back to this tomorrow.
Thanks Melissa. I will be in contact again, no doubt.
I need to wait for the data to refresh, which is over 6.5M rows.
I need to step away and come back to this tomorrow.
Thanks Melissa. I will be in contact again, no doubt.
Hi,
Iāve managed to remove the non printable characters at the end of the name for [Terminal ID]. However, I am now getting an error which states that
The field āPurchase Start Date & Timeā of the record wasnāt found.
This particular column is a calculated column.
Any ideas?
Can you translate that logic to M?
If not what is the DAX syntax for that CC?
Here is a link to the full PBIX.
https://drive.google.com/file/d/1yb_YXG_nRrm-1964OGJPqr_ACpcg0u4O/view?usp=sharing
Ideally, I donāt even need Purchase Duration in the P&D Table, as I currently have something similar in Tariffs[Tariffs Duration]. What I need is for the blank entries of the Purchase End Date and Time to be populated based on the data.
Chris
I assumed that my DAX for a calculated column which works for P&D Purchases[Purchase Tariff Name], could just be substituted with āTariffsā[Tariff Duration] as below. But it doesnāt work.
Purchase Tariff Name = CALCULATE(
VALUES( āTariffsā[Tariff Duration] ) ,
FILTER( Tariffs ,
āP&D Purchasesā[Terminal ID] = āTariffsā[Terminal ID ] &&
āP&D Purchasesā[Purchase Start Day Name] = āTariffsā[Day Name] &&
āP&D Purchasesā[Purchase Start Date & Time] >= āTariffsā[Tariff Start Date] &&
āP&D Purchasesā[Purchase Start Date & Time] <= āTariffsā[Tariff End Date] &&
āP&D Purchasesā[Purchase Amount] >= āTariffsā[Tariff Amount Start] &&
āP&D Purchasesā[Purchase Amount] <= āTariffsā[Tariff Amount End] &&
( ( āP&D Purchasesā[Purchase Start Time] >= āTariffsā[Tariff Start Time 1] * (1/24) &&
āP&D Purchasesā[Purchase Start Time] < āTariffsā[Tariff End Time 1] * (1/24) ) ||
( āP&D Purchasesā[Purchase Start Time] >= āTariffsā[Tariff Start Time 2] * (1/24) &&
āP&D Purchasesā[Purchase Start Time] < āTariffsā[Tariff End Time 2] * (1/24) ) ) ) )
Hi @chrisgreenslade,
No that doesnāt work and hereās why. If you lookup this record in P&D Purchases
So the result is 1 distinct Tariff Name but 2 distinct Tariff Durationsā¦
This overlap in date range is something you should resolve in your Tariffs dimension table.
Let me know how you want to handle this.
I think the Tariff End Date for M-HARD-1 in the first row should read 04-04-19, so that the tariff is unique. The Tariff duration is also incorrect and should be 10 hrs (not 13).
Does the DAX now calculate for Purchase Duration? The ultimate goal is to have a visual that shows cars entering and leaving a car park over the course of a day, week, etc.
Currently our data is nasty from a particular source, which means we donāt get a purchase start and end date. Otherwise, this would have been an easy exercise.
I need to fill in the blanks from the company that canāt provide the above, but also analyse car park occupancy throughout the day.
Itās a nightmare.
Hi @chrisgreenslade,
I do agree with you thereā¦
Hopefully you understand that before you move on, you need resolve all these types of issues in your data. Otherwise how can you expect a valid outcome when your dimension table contains records that are āwrongā - no amount of M or DAX code can account for that.
Furthermore Iād suggest to close this thread, now. Feel free to open a new topic once all issues with your data have been resolved.
Thank you.