Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jmkvalsund
Helper II
Helper II

CALCULATETABLE using measure does not work as intended

I’m trying to create a calculated table containing salesresults for a specific team like this, using a measure to identify the team:

T_SalesByTeam = CALCULATETABLE(SUMMARIZE('Sales','Sales'[DateID],'Sales'[AccountManager],"Total sales",SUM('Sales'[Sales_Value])),FILTER('Teams',Teams[TeamID]=M_CurrentTeam))

 

But even though the measure M_CurrentTeam contains the right value (integer 8, put on a card for control), the table does not contain results from more than one team-member.  And I suspect not all the results for this one either.
However, if I change the statement and put in 8 as a fixed number,

T_SalesByTeam = CALCULATETABLE(SUMMARIZE('Sales','Sales'[DateID],'Sales'[AccountManager],"Total sales",SUM('Sales'[Sales_Value])),FILTER('Teams',Teams[TeamID]=8))

I get the results from all members in team 8.

There must be something I don’t understand about when or where the measure is calculated.

The measure is created like this and returns the correct value depending on [CurrentUser]

M_CurrentTeam = MAXX(FILTER(Teams,Teams[UserID]=[CurrentUser]),Teams[TeamID]))

Why can't I use this measure in the CALCULATETABLE statement?

Regards,
John 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jmkvalsund , A calculated table can not use a slicer value. means they will take static value of slicer

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@jmkvalsund , A calculated table can not use a slicer value. means they will take static value of slicer

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.