We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hey there,
I am very new in PowerBI and I could use some help with this (hopefully) simple task.
I have 2 tables.
Table 1: Activities
Large table with many columns. Most important for now is the 'start' column, with the date of the record submission, and the 'Village' column indicating which village was visited. There will be multiple records in the table for each village.
Table 2: Villages
A table with a number of village names. Each village will be in here only once.
What I'm trying to do, is to find the most recent record (visit) for each village in the activity table. I thought I'd calculate a new column in the Village table, and fetch the most recent record for that village from the Activity table, but I can't figure out how to do this. Note that it can be possible that some villages are never visited, so then then won't be found in any of the records in the Activity table.
Hopefully someone can help me!
Thanks in advance!
Solved! Go to Solution.
@ThijsvdZaan , In the Villages table, create a new calculated column to find the most recent visit date for each village. You can do this by using the following DAX formula:
DAX
MostRecentVisit =
IF(
ISBLANK(
CALCULATE(
MAX(Activities[start]),
FILTER(
Activities,
Activities[Village] = Villages[Village]
)
)
),
"No Visits",
CALCULATE(
MAX(Activities[start]),
FILTER(
Activities,
Activities[Village] = Villages[Village]
)
)
)
Proud to be a Super User! |
|
@ThijsvdZaan , In the Villages table, create a new calculated column to find the most recent visit date for each village. You can do this by using the following DAX formula:
DAX
MostRecentVisit =
IF(
ISBLANK(
CALCULATE(
MAX(Activities[start]),
FILTER(
Activities,
Activities[Village] = Villages[Village]
)
)
),
"No Visits",
CALCULATE(
MAX(Activities[start]),
FILTER(
Activities,
Activities[Village] = Villages[Village]
)
)
)
Proud to be a Super User! |
|
That worked just fine, thank you!!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 54 | |
| 39 | |
| 33 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 62 | |
| 38 | |
| 34 | |
| 22 |