cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
morgtd30
Helper I
Helper I

Making Matrix Table Aggregates Match

I have a column that shows the last date a contact was interacted with. I'm having that value being aggregated to "Latest" to have it display on the account it belongs to if the group is not expanded. I'm wondering if it's possible to have the other values that display be based on that column:

morgtd30_1-1661265334389.png

 

In this example, Human 3's date has the most recent activity date and displays at the top of the grouping. Is it possible to have it display the corresponding "948000004" and "Site Visit" at the top of the grouping from that row as well? 

 

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @morgtd30 ,

 

You could use ISINSCOPE() function to return specific value at subtotal.

measure1 =
var max_date = calculate(max([date]),allexcept('table',[city]))
var max_column1 = calculate(max([column1]),FILTER(allexcept('table',[city]),[date] = max_date))

return
if(isinscope([human]),selectedvalue([column1]),max_column1)

The same for column2.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

Hi @morgtd30 ,

 

You could use ISINSCOPE() function to return specific value at subtotal.

measure1 =
var max_date = calculate(max([date]),allexcept('table',[city]))
var max_column1 = calculate(max([column1]),FILTER(allexcept('table',[city]),[date] = max_date))

return
if(isinscope([human]),selectedvalue([column1]),max_column1)

The same for column2.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

I fixed the issue. I had the wrong date field in the first var. It works perfectly now!

 

Changed to:

 

ActLastActivityType =
var max_date = calculate(max(contacts[wc_lastactivitydate]),allexcept(contacts,contacts[Account Name]))
var max_contactrole = calculate(max(contacts[wc_contactrole]),filter(allexcept(contacts,contacts[Account Name]),contacts[wc_lastactivitydate] = max_date))

return
if(isinscope(contacts[fullname]),selectedvalue(contacts[wc_contactrole]),max_contactrole)

Jay thank you for the help.
I'm not getting any values at summarized at the top for that new measure:

morgtd30_1-1661526851058.png

It should bring 948000004 to the top.

Here's an example of how my tables are built:

Account Name
City 1
City 2

 

Contact NameAccount NameContact RoleContact TypeContact Date
Human 1City 1948000000E-Mail8/8/2022
Human 2City 1948000002E-Mail8/7/2022
Human 3City 1948000004Site Visit8/18/2022
Human 4City 1948000010E-Mail 

 

Here's my measure:

ActLastActivityType =
var max_date = calculate(max('Date'[Date]),allexcept(contacts,contacts[Account Name]))
var max_contactrole = calculate(max(contacts[wc_contactrole]),filter(allexcept(contacts,contacts[Account Name]),contacts[wc_lastactivitydate] = max_date))

return
if(isinscope(contacts[fullname]),selectedvalue(contacts[wc_contactrole]),max_contactrole)

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors