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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Get all values to be absolute numbers, but get sum correct

Hi,

 

I'm trying to figure out how i might be able to have all accounts showing absolute numbers, but still getting the hierarchy sum to be correct. 

 

below is just a snapshot of an example of how it looks like now, but would like all numbers to be absolute.
Its just a sum of General ledger amount

 

I see this could be an issue in case EBITDA or other summaries becomes negative, then I would like them to show negative still, but on account level all should show absolute numbers. Is this possible?

 

account.jpg

 

Thanks!

2 ACCEPTED SOLUTIONS

You should be able to use ISINSCOPE() to get your result.  For example,

 

NewMeasure = IF(ISINSCOPE(HierarchyTable[Account_no]), ABS(SUM(Fact[Amount])), SUM(Fact[Amount]))

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

Anonymous
Not applicable

Hi @Anonymous ,

 

You can use "Isinscope"function to realize it,measure is as below:

 

Measure = IF(ISINSCOPE('Table (2)'[Amount]),ABS(MAX('Table (2)'[Amount])),SUMX(ALL('Table (2)'),'Table (2)'[Amount]))

 

Finally you will see:

Annotation 2020-06-10 173723.png

For the related .pbix file,pls click here.

 

 
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

6 REPLIES 6
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

I have a workaround for you:

First create a table as below:

Annotation 2020-06-09 152527.png

Then union Total with other rows in table [Revenue] using below dax expression:

 

Union table = UNION(ALL('Table'[Revenue ]),'Table (2)')

 

Create a relationship between the union table and the original table;

Finally create a measure as below:

 

Measure = 
IF(MAX('Union table'[Revenue ]) in FILTERS('Table'[Revenue ]),IF(MAX('Table'[Value])<0,ABS(MAX('Table'[Value])),MAX('Table'[Value])),SUMX(ALL('Table'),'Table'[Value]
))

 

And you will see; (Set subtotals:off)

Annotation 2020-06-09 152836.png

For the related .pbix file,pls click here.

 


 
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Anonymous
Not applicable

Wow, this is great, thanks!
Unfortunately, I don't think its exactly what I would like. I have a table with accounting setup, different classes based on account level, currently using account number and class 3 in a hierarchy where class 3 sums up every account in that class.
I might be misunderstanding, but if I'm using this setup not sure if your solution works..

 

Thanks!

Anonymous
Not applicable

Hi @Anonymous ,

 

Can you provide some sample data for me to test?

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Anonymous
Not applicable

Hi,

I have uploaded a sample pbix file here

If that link is not working, the two sample tables i have created are below:

 

Account_noclass 3class 3 no
1000Revenue1
1001Revenue1
1003Revenue1
1005Revenue1
1006Revenue1
1007Revenue1
1008Revenue1
1101COGS2
1102COGS2
1105COGS2
1120COGS2
1150COGS2
1300Salary3
1301Salary3
1302Salary3
1309Salary3

 

 

account noAmount
10001000
1000123
10001244
10001241
100012
10002423
1000-12
1001242
1001-123
1001-122
1001-532
100121
100198
1003123
1003432
10034322
10051234
1006123
10061
10062
10073
10074
10085
100824
1008234
1101-123
1101-1243
1101-21
1101-234
1101-21
1101-23
1101-234
1102-21
110222
1120-214
1120-23
1120-23
1150-12
1150-24
1150-21
1150-144
1300-21
1300-21
1300-42
1301-234
1301-2
130221
1302-32
1302-33
1309-42
1309-2
1309-4
Anonymous
Not applicable

Hi @Anonymous ,

 

You can use "Isinscope"function to realize it,measure is as below:

 

Measure = IF(ISINSCOPE('Table (2)'[Amount]),ABS(MAX('Table (2)'[Amount])),SUMX(ALL('Table (2)'),'Table (2)'[Amount]))

 

Finally you will see:

Annotation 2020-06-10 173723.png

For the related .pbix file,pls click here.

 

 
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

You should be able to use ISINSCOPE() to get your result.  For example,

 

NewMeasure = IF(ISINSCOPE(HierarchyTable[Account_no]), ABS(SUM(Fact[Amount])), SUM(Fact[Amount]))

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.