cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Regular Visitor

## How to know the category related to a subcategory shown on a matrix visualization

Hi guys,

I really need your help, I have a model with 2 dimmensions (Banks and Concepts) and 1 fact table (Transactions" and I need to make different calculation based on the Bank selected. For example, if the bank is Colombian, just add the values, but if not, I have to multiply the value by the change rate, before adding it to the subtotal.

I have to different matrix visualizations, in the first one I show the bank and the transactional values and in the other one I show  the concepts and the transactional values.

I already managed with a measure to make the right calculations at bank / concept levels, but I have not been able to show the right totals. Could someone help me please

My model and the expected results are:

based on the following data (I'm just multiplying JP Morgan transactions by 1000):

But the results that I'm getting are:

Using the measure:

Calculo =
var resOtros = SUM('Transacción'[Valor])
var resJP = AVERAGE('Transacción'[Valor]) * 1000
var tempTable = FILTER(Conceptos, RELATED(Bancos[Banco]) = "JP Morgan")
var salConc = IF(COUNTROWS(tempTable) = 1, resJP, resOtros)
var salBco = IF(SELECTEDVALUE(Bancos[Banco]) = "JP Morgan", resJP, resOtros)
var Nbancos = ISINSCOPE(Bancos[Banco])
var final = IF(Nbancos, salBco, salConc) // Este resultado sirve a nivel filtrado, no en el total
return final

Kind regards,
Maria Isabel
2 REPLIES 2
Super User

Hi @mserrano95431 Usually, transaction table is the lowest grain of granularity in data. I do not understand why you model your data as on picture.

In your Conceptos, there are two times 11 Cod Banko and in transaction it is both time 11000, which is total 22 000 (simple math). I do not understand why you need Conceptos. If possible, put data from this table to Transaction and remodel relationship.

Relationships in your picture is not the best practice so you will need to rework somehow your model as measures for sure give some output, but it is hard to comment and spot some bug. Hope this help

Proud to be a Super User!

Regular Visitor

Hi @some_bih the data shown is dummy, the real info are bank statements. We have relatonships with different banks and the ones in my country share some types of transactions, but JP Morgan has its own types, thats why I have the bank dimmensional table and the type of transactions ("conceptos") dimmensional table, bsides the real transactional fact table that change every month.
Despite this, I undesrstand what you said and I'll work on that, thank you.

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors