How can i add 2 rows in my table in which one row shows sum all values as 'T' and other row will shows sum of only values in bottom 4 rows as 'F'.
Here stage is coming from a table and 'current','previous','%change' are measures
After my research, you could try this way:
Add a Stage table with two more rows like thisIn my simple case, I just show top2 result as "F")
Then create a relationship with basic data table.
Create the rank measure for each measure
Rank = RANKX(ALL('Table1'), [sumqty])
Add a new measure for 'current'
Measure = IF ( SELECTEDVALUE ( Table2[Stage] ) = "TOTAL", CALCULATE ( [sumqty], ALL(Table2[Stage]) ), IF ( SELECTEDVALUE ( Table2[Stage] ) = "TOP2", SUMX ( FILTER ( ALL ( 'Table2'[Stage] ), [Rank] <= 2 ), [sumqty] ), [sumqty] ) )
You could also add new measure for 'previous','%change' by the same logic.
here is pbix file, please try it.
and this is the same logic post I have solved for you refer to