Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Good afternoon to all,
I have the necessity to show in a single column of a matrix different measures.
I found some tips in the forum so I followed these steps:
1) Calculated all the measures;
2) Created a table with two columns; first: Id, second: the descriptions of the row i want to show;
3) Created a measure to expose each measure calculated in step1 into the matrix. The measure is this:
Each row has the correct value calculated in point 1 and even the grand total is correct.
Now I come to the point.
I applied some multiplication in each measure to make a what if analysis.
If I check the value of each measure it is correct while if i put it into the matrix (with the same method) it doesn't return me the right value.
I give you an example:
I would like that the value shown in the firs row could be 7.383.084,67€ while it returns me another value. Even the grand totale is wrong
Probably there is some issue with the filter context.
Can you help me?
Thank you
Enrico
Solved! Go to Solution.
@ermeggy_1298 @v-linyulu-msft in my opinion you have to give the granularity of the sector in your measures, like:
Thanks for the reply from @BeaBF , please allow me to provide another insight:
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2.Since the output contains multiple judgment statements, I recommend using the SWITCH() function. Here are my calculation columns:
Importo geo settoriale =
SWITCH(TRUE(),
[Settore] = "Agricoltura" ,[EAD_AGRICOLTURA]*[EAD_INDUSTRIA],
[Settore] = "Amministrazioni pubbliche", [EAD_AMM.PUBBLICHE],
[Settore] = "Edilizia", [EAD_EDILIZIA],
[Settore] = "Famiglie consumatrici", [EAD_FAMIGLIE],
[Settore] = "Imprese finanziarie ed assicurative", [EAD_IMPRESE],
[Settore] = "Industria", [EAD_INDUSTRIA],
[Settore] = "Servizi", [EAD_SERVIZI],
BLANK())
In My calculation columns, you can modify the output to add, subtract, multiply, divide, and so on.
3.Here's my final result, which I hope meets your requirements.
4.The following are links to related documents, hope to help you:
SWITCH function (DAX) - DAX | Microsoft Learn
Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Good afternoon,
I tried with the solution you gave but it is not working.
I provide you a link where you can download the file I am working with:
Please consider the sheet "Hp2_rischio di conc.geo-settoriale stress".
I tried to write three measues with 3 different methods:
@ermeggy_1298 @v-linyulu-msft in my opinion you have to give the granularity of the sector in your measures, like:
Thanks to your advice I found the solution. The problem was that the "layout" table in which there are the sectors names is connected to the data table so the filter context was activated.
I created a new layout teble which is not relate to the data table and now all the calculated measures are reported correctly in the calculated column.
Enrico
I tried even this measure but it doesn't work.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
23 | |
21 | |
20 | |
14 | |
12 |
User | Count |
---|---|
43 | |
31 | |
24 | |
22 | |
22 |