Forum Discussion
Calculate Values based on a Distribution Key in a linked Table
- 3 years ago
Try
Current Measure = SUMX ( VALUES ( DimDeskDistribution[Desk] ), VAR CurrentProject = SELECTEDVALUE ( DimDeskDistribution[Project ID] ) VAR Result = CALCULATE ( [Storypoint Measure], TREATAS ( { CurrentProject }, DimProject[Project ID] ) ) * CALCULATE ( MAX ( DimDeskdistribution[DeskDistribution] ) ) RETURN Result )
I can't see where any problems might be coming from. All I can offer is some general tips on how I would proceed with debugging.
Run the SUMMARIZE from the code in DAX Studio and see if the resulting table has the values you expect.
Use Performance Analyzer to grab the code generated for your visual and run it in Tabular Editor 3 so that you can use the Debug Cell functionality to step into the code and see what the filter context is at each stage, and what the intermediate results are.
Use EVALULATEANDLOG with DAX Debug Output to show the values and filters at different stages.
Hello,
unfortunately i did not manage to get any solution.
DimDeskDistribution has a many to One Relation to DimProject
DimProject has a One to Many Relationship to The FactTable
the FactTable has a MAny to OnE Relationship to DimStatus
The Storypoints are In The FactTable
The Measure for StorypointsCompleted is: Storypoints Completed = CALCULATE(SUM(Facttable[StoryPoints]), DimStatus[Status] IN {"Closed", "Done/In Production"})
Could it be because of the Filter Direction? there is only single filtering in the data model
I tried to apply a Crossfilterfunction from DimDeskdistribution to DimProject but did not manage to get any results.
When i use the The measure and only Desk in Rows, it returns a single desk with the total amoutn of storypoints for all projects. ITs the desk with the highest ProjectID assignment