Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Been scrolling through the forums but haven't found an answer to this yet (likely searching the wrong terms), hoping someone here can point me in the right direction. I'm just coming back to the Data Analytics field after an extended period away so trying to shake off that rust. I hope the format I put it in below is easy to follow and that I haven't doubled up on this question.
The Overview
I have two tables dimDates and Transactions (in fact there are two Transaction tables but will keep this example with one as they are independent) with a relationship based on a dateKey field that is "DimDates 1>* Transactions". Tables look something like this (created with random dates just to demonstrate example date table is a full featured table of dates):
Date | DateKey |
2019-05-23 | 1 |
2020-07-30 | 2 |
2020-01-08 | 3 |
2022-06-25 | 4 |
DateKey | Account | Amount |
3 | A | 20 |
2 | A | 30 |
2 | B | 4 |
1 | C | 5 |
The Issue
I'm looking to create a card that displays the latest transaction date and total transactions with a visual filter based on Account. So a card filtered for Account A would display "2020-07-30" and "50". Unfortunately when I do this currently due to the direction of the relationship I only get the last date of the DimDates table "2022-06-25".
Attempts to resolve
I attempted to try resolve this with changing both direction and it solves the problem for the card but creates no end of issues for other visuals such as rolling totals, so that wasn't viable. I attempted to solve it with a measure using the DAX Related but it can't seem to interact with the DimDates table for some reason.
Solved! Go to Solution.
Here is the solution:
Model view:
I usually don't ask, but this time I'd appreciate an Accepted solution with a thumbs up. 😁 Cheers!
Here is the solution:
Model view:
I usually don't ask, but this time I'd appreciate an Accepted solution with a thumbs up. 😁 Cheers!
That worked a charm. I thought for a second it wasn't working as the cards were showing up blank. But I think it was because it tooks a while for the measures to populate.
Also, try showing ChatGPT 4 (use the Data Analyst GPT) the model with the relation and ask it to come up with the DAX code. Should be interesting.
Unfortunately I won't use ChatGPT since it requires PII to utilise it. I had tried some local LLMs but they didn't quite cut it with their limited parameter size.
Wasn't the cost issue. It was the need to give your mobile phone to them to use it.
Weird, should be instant. At least, it is on my PC.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
87 | |
87 | |
87 | |
67 | |
49 |
User | Count |
---|---|
135 | |
113 | |
100 | |
68 | |
67 |