Forum Discussion
Add Measure as a Column Subtotal in a Matrix
- 1 year ago
First, add a day column to your fact table. Then create this disconnected calculated table.
CombinedDimensions = VAR _day = DISTINCT ( SELECTCOLUMNS ( Cuadrante, "Day", FORMAT ( Cuadrante[Dia], "#,#" ), "Sort", Cuadrante[Dia] ) ) VAR tvb = DATATABLE ( "Day", STRING, "Sort", INTEGER, { { "T", 51 }, { "V", 52 }, { "B", 53 } } ) RETURN UNION ( _day, tvb )Dont forget to apply custom sort.
Create this measure to bind your fact table and this disconnected table in a viz.
CombinedValue = IF ( SELECTEDVALUE ( CombinedDimensions[Sort] ) <= 31, CALCULATE ( MIN ( Cuadrante[EVENTO] ), KEEPFILTERS ( TREATAS ( VALUES ( CombinedDimensions[Sort] ), Cuadrante[Dia] ) ) ), SWITCH ( SELECTEDVALUE ( CombinedDimensions[Day] ), "T", FORMAT ( [Total_mañanas], "#,0" ), "V", FORMAT ( [Total_Vacaciones], "#,0" ), "B", FORMAT ( [Total_baja], "#,0" ) ) )And the result is
Reapply conditional formatting.
Please see attached pbix
Hello.
What I want is that after the last day of the month these three calculated measures (T, V and B) appear. or some idea to visualize the two matrices in the same order and if one is ordered, the other is ordered.
I add a link in drive to share the file:
https://drive.google.com/file/d/1n5E3vDVFO2VUz640JsPX0KBhHRn9fk75/view?usp=sharing
First, add a day column to your fact table. Then create this disconnected calculated table.
CombinedDimensions =
VAR _day =
DISTINCT (
SELECTCOLUMNS (
Cuadrante,
"Day", FORMAT ( Cuadrante[Dia], "#,#" ),
"Sort", Cuadrante[Dia]
)
)
VAR tvb =
DATATABLE (
"Day", STRING,
"Sort", INTEGER,
{
{ "T", 51 },
{ "V", 52 },
{ "B", 53 }
}
)
RETURN
UNION ( _day, tvb )
Dont forget to apply custom sort.
Create this measure to bind your fact table and this disconnected table in a viz.
CombinedValue =
IF (
SELECTEDVALUE ( CombinedDimensions[Sort] ) <= 31,
CALCULATE (
MIN ( Cuadrante[EVENTO] ),
KEEPFILTERS ( TREATAS ( VALUES ( CombinedDimensions[Sort] ), Cuadrante[Dia] ) )
),
SWITCH (
SELECTEDVALUE ( CombinedDimensions[Day] ),
"T", FORMAT ( [Total_mañanas], "#,0" ),
"V", FORMAT ( [Total_Vacaciones], "#,0" ),
"B", FORMAT ( [Total_baja], "#,0" )
)
)
And the result is
Reapply conditional formatting.
Please see attached pbix
- Syndicate_Admin1 year agoAdministrator
Perfect, this is just what I needed. I have analyzed the process and it is a great development.
Thanks a lot.