Forum Discussion

ELToninio's avatar
ELToninio
Frequent Visitor
1 year ago

Repeated Labels and Values Matrix table

Hello,

I have 3 fact tables :

Cost per nature (All Data Table) ; Cost per runnings costs ; cost per subcategory of running cost

 

I have a hierarchy as followed :

Nature of Costs (1) : within I have Running Costs, Salaries etc...

Nature of Running Costs (2) (here is a focus on only running costs)

Subcategory of Running Costs (3)

 

First problem :

However when I build my matrix, with my formula I managed to make sure that Nature of Costs cannot be drilldown unless it is "Running Costs". When we go into the nature of running costs I manage to prevent drilldown from happening for values that are not equal to "Travel Expenses" but I wanted to add more values to the list aside of Travel Expenses, and i don't know how to do that. See my code below.

 

Second problem :

In my table matrix, all the subcategory of runnings labels are showing up into each Nature of Running Costs and I don't understand why there are not splitted in each Running costs they belong to. On top of that the amount of the Nature Of Running Costs subtotal is repeated in each row of the subcategory. How could I fix that ? Maybe it comes from my messy model ? (see below)

 

 

My formula

Running Cost per Category =
VAR TotalNatureOfCosts = sum('All Datas'[Costs YTD])
VAR TotalNatureOfRunningCosts = sum('Actuals Nature of Running Costs'[Costs YTD])
VAR TotalSubcategoryRunningCosts = sum('Actuals Sub Running Costs'[Costs YTD])
VAR FiltreNatureOfCosts = ISINSCOPE('Table Nature of Costs'[Nature of Costs])
VAR FiltreNatureOfRunning = isinscope('Nature of Running Costs'[Nature of running costs])
VAR FiltreSubcategoryRunning = isinscope('Actuals Sub Running Costs'[Subcategory of Running Cost])

Return IF(FiltreNatureOfRunning = true() && selectedvalue('Table Nature of Costs'[Nature of Costs]) <> "Running costs", blank(),
        IF(FiltreSubcategoryRunning = true() && selectedvalue('Nature of Running Costs'[Nature of running costs]) <> "N07 - Travel expenses", blank(),
        IF(FiltreNatureOfRunning = true(), TotalNatureOfRunningCosts,
        IF(FiltreSubcategoryRunning = true (), TotalSubcategoryRunningCosts, TotalNatureOfCosts))))
 
My model :

 

 

thank you very much

 

 
 

2 Replies