Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Fix subtotal and total measure evaluated in differente levels of Hierarchy

 

Good morning 

 

I would really appreciate your help with this request: 

Context:

I currently have a matrix within 3 levels in the rows and some measures 

Rows :

Bank name (Category 1)  

Account Type (Category 2)

Account Name ( Catgory 3) 

 

What I need is to create a measure who evaluates the account type taking into account there are 2 options, and return an specific calculation different for each one. This last request i just solved it using Measure 1. 

However, when I try to get the subtotals for Category 1 and  the grand total, i just have not figured out how, because it must be sum of the results of evaluating the type of account,  I mean the sum of the subtotals I got from Category 2 

 

Table : Account Type

codname
1COR
2AHO

For identify wich type an account is, I used the code  from the table above 

 

Measure 1 : 

VAR COR= [Measure23]-[Measure44]+[Measure45]
VAR AHO= [Measure22]-[Measure44]+[Measure45]
VAR AT = SUM(Account_Type_code)
RETURN
SWITCH ( Account_Type,
1,COR,2,AHO,3,"")

 

Davidsagi_0-1637597754344.png

Here I need to get the right value that would be  the sum of 26.498.449.893+7.430.738.545.94 , this per category and grand total. 

Thanks. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

At the end, I use SUMMARIZE for creating a virtual table, within a new column where the condition were applied, the use SUMX in order to get the value I needed . 

🙂 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

At the end, I use SUMMARIZE for creating a virtual table, within a new column where the condition were applied, the use SUMX in order to get the value I needed . 

🙂 

amitchandak
Super User
Super User

@Anonymous , I think you need to use isinscope for that

 

if(isinscope (Table[Account Type]), [Measure1], [Measure2])

 

https://xxlbi.com/blog/new-dax-function-isinscope/

Anonymous
Not applicable

Morning,

 

Thanks for your answer, isinscope coulw work too, but that part is already working in my modelo. the one I need is for the subtotal per category 1 that should return the result of evaluating the measure 1 +  result of evaluating the measure 2. 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors