cancel
Showing results for 
Search instead for 
Did you mean: 

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

Reply
mserrano95431
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:

mserrano95431_0-1695527044680.png    

mserrano95431_1-1695527099571.png

 

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

mserrano95431_2-1695527232416.png

 

But the results that I'm getting are:

mserrano95431_3-1695527349144.png

 

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
 
I really appreciate any help you can give me,
Kind regards,
Maria Isabel
2 REPLIES 2
some_bih
Super User
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





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






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.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

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

Power BI Fabric Summit Carousel

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