Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all,
I have two tables:
Volunteers:
ID | ... | Last Action Date
Volunteer Actions:
ID | Volunteer ID | Action Type | Action Date
I want to put the last Action Date from Volunteer Actions into Volunteers Table but only for specific Action Type
I have tried:
Solved! Go to Solution.
@tom_malkiewicz As soon as you put CALCULATE in a calculated column, it essentially turns it into a measure context.
I am assuming that the relationship between these two tables is a 1 to many with single cross filter direction? Because of that you can't get the columns from the Volunteer Actions table into Volunteers table without changing the cross filter direction to both with I don't necessarily recommend.
Is there a reason you need this created as a calculated column and can't just create the matrix or table visual using the aggregation LATEST on Action Date?
When do you want to filter for the action type? I'm going to assume you want to pull the latest date for that action type, rather than latest date for all actions.
You can use SUMMARIZECOLUMNS to get that aggregation into the data model if needed, try this:
As CALCULATED TABLE
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@tom_malkiewicz As soon as you put CALCULATE in a calculated column, it essentially turns it into a measure context.
I am assuming that the relationship between these two tables is a 1 to many with single cross filter direction? Because of that you can't get the columns from the Volunteer Actions table into Volunteers table without changing the cross filter direction to both with I don't necessarily recommend.
Is there a reason you need this created as a calculated column and can't just create the matrix or table visual using the aggregation LATEST on Action Date?
When do you want to filter for the action type? I'm going to assume you want to pull the latest date for that action type, rather than latest date for all actions.
You can use SUMMARIZECOLUMNS to get that aggregation into the data model if needed, try this:
As CALCULATED TABLE
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Calculated table worked. Thank you
I created two - 1 for Max date and one for Min date. Is there a way to have both columns in one calculated table? I mean Volunteer ID and Earliest Date and Latest Date?
All the best
Tom
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
The one you create is it a measure or column ?
you can move data from one table to another like these examples
All are new columns
Item Name = RELATED('item'[Brand])
City Name = maxx(FILTER(geography,geography[City Id]=Sales[City Id]),geography[City]) // error for datatype
Month Name = LOOKUPVALUE('date'[Month Year],'date'[Date],Sales[Sales Date])
I want to created a calculated column with a max date from another table but only max date of specific subset of dates (Filtered by action type)
I hope I am making sense
EDIT
So I tried after your adivse to use MAXX
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |