Forum Discussion
Get RAG by Project but always keep one extra row for dedicated Project
- 8 months ago
Hi Jyaul1122 ,
Just to understand the model a little bit better so that you can have the correct approach:
- Geo column part of your Fact table?
- Do you have any dimension on your model that has the Geo reference?
Asking this because of the context of your calculation lets just pick up a simple table with the following data:
Geo column Geo1 Geo2 Geo3 If I use this column in a visualization and also use it in a slicer the visualization will only show the values I select.
Lets assume I have select Geo1 on the slicer the visual will only show visual Geo1 and since they are the same column I'm not able to show a different value because the overall data that I have available for the visual is only that specific values Geo1 all other no matter how I try to pick them up will never show because they are not part of the data selected for the visual.
When you use a dimension table you will be able to change the context of the fact table because you can overwrite the filter context being passed trough the relationship betwen dimension and fact using the ALL, CROSSFILTER or other similar formulas.
Hi Jyaul1122 ,
Create a table for the Geo with unique values then try the following update of the measure:
RAG =
CALCULATE (
VAR maximum_District =
VALUES ( Dim[District] )
VAR maximum_geo =
VALUES ( Geo[Geo] )
VAR District =
MAXX ( FILTER ( 'Fact', 'Fact'[Project] IN maximum_District ), 'Fact'[RAG] )
VAR Project =
MAXX (
FILTER ( 'Fact', 'Fact'[Project] IN VALUES ( Dim[Project] ) && 'Fact'[Geo] in maximum_geo ),
'Fact'[RAG]
)
VAR Geo =
MAXX ( FILTER ( 'Fact', 'Fact'[Project] IN maximum_District ), 'Fact'[RAG] )
RETURN
IF ( District = BLANK (), Project, District ),
CROSSFILTER ( 'Fact'[Project], Dim[Project], NONE )
)
I can not create separate table for Geo as my data model is already overloaded.
- MFelix8 months ago
Super User
Hi Jyaul1122 ,
Just to understand the model a little bit better so that you can have the correct approach:
- Geo column part of your Fact table?
- Do you have any dimension on your model that has the Geo reference?
Asking this because of the context of your calculation lets just pick up a simple table with the following data:
Geo column Geo1 Geo2 Geo3 If I use this column in a visualization and also use it in a slicer the visualization will only show the values I select.
Lets assume I have select Geo1 on the slicer the visual will only show visual Geo1 and since they are the same column I'm not able to show a different value because the overall data that I have available for the visual is only that specific values Geo1 all other no matter how I try to pick them up will never show because they are not part of the data selected for the visual.
When you use a dimension table you will be able to change the context of the fact table because you can overwrite the filter context being passed trough the relationship betwen dimension and fact using the ALL, CROSSFILTER or other similar formulas.
- v-saisrao-msft8 months ago
Community Support
Hi Jyaul1122,
Have you had a chance to review the solution we shared by MFelix? If the issue persists, feel free to reply so we can help further.
Thank you.