Forum Discussion
BIlix
Helper II
3 years agoCalculate Values based on a Distribution Key in a linked Table
Hello Community, I want to Calculate Values from my Fact Table based on another Table. I have Story Points in my Fact Table. I already have a Measure to Calculate the StoryPoints i need. TH...
- 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 )
johnt75
Super User
3 years agoI 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.
BIlix
Helper II
3 years agoHello again,
i managed to find a solution for the problem:
Storypoint distributed to Desk = SUMX (
CALCULATETABLE (
SUMMARIZE (
FILTER (
DimDeskDistribution,
NOT ( ISBLANK ( [StorypointMeasure] ) )
),
DimDeskDistribution[Desk],
DimDeskDistribution[DeskDistribution],
DimProject[ProjectID],
DimProject[Project]
),
CROSSFILTER ( DimDeskDistribution[ProjectID], DimProject[ProjectID], Both )
),
[StorypointMEasre] * DimDeskDistribution[DeskDistribution]
)
I now want to distirbute another measure to Desks in a similar way.
The measure itself are summed up costs from a fact table.
The Facttable is related many to one to a project2 Dimension.
The project2dimension is related one to many to the project DImension.
The Project Dimension is related one to many to The Deskdistribution DImension.
No crossfiltering is enabled. I can not change the Relationships to crossfiltering and should not add more active relationships. Any Ideas how i could get a workaround for my Dax Function? Thanks in advance
I now want to distirbute another measure to Desks in a similar way.
The measure itself are summed up costs from a fact table.
The Facttable is related many to one to a project2 Dimension.
The project2dimension is related one to many to the project DImension.
The Project Dimension is related one to many to The Deskdistribution DImension.
No crossfiltering is enabled. I can not change the Relationships to crossfiltering and should not add more active relationships. Any Ideas how i could get a workaround for my Dax Function? Thanks in advance