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

Taking the total of a column and assigning that to a row in the same column | Need DAX help

How can  I take the sum/total of a measure and assign that to another row in that same column?

 

Let me explain...

 

Let's say I  have a table with Ranks/Categories such as:

 

RANKS
IMP0
IMP1
IMP2
IMP3

IMP4

IMP5

 

I have a measure which has values for IMP1-IMP5. I want the TOTAL of IMP1-5 to be put into IMP0.

RANKSIMPRESSIONS
IMP0 
IMP150
IMP2100
IMP3150
IMP450
IMP550
TOTAL400

 

END RESULT

RANKSIMPRESSIONS
IMP0400
IMP150
IMP2100
IMP3150
IMP450
IMP550
TOTAL400

 

the sum of imp1-5 is 400 so 400 is placed within IMP0.

 

Is this achievable?

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try like

if(max(Table[IMP0]) ="IMP0", calculate(sum(Table[IMPRESSIONS]), filter(all(Table), Table[IMP0] <> "IMP0")) ,sum(Table[IMPRESSIONS]) )

View solution in original post

2 REPLIES 2
V-pazhen-msft
Community Support
Community Support

@Anonymous 

I guess this is what you want: 

Measure = IF(max('Table'[RANKS]) ="IMP0", SUMX(ALL('Table'),[IMPRESSIONS]),[IMPRESSIONS])

sumx measure.JPG

 


Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , Try like

if(max(Table[IMP0]) ="IMP0", calculate(sum(Table[IMPRESSIONS]), filter(all(Table), Table[IMP0] <> "IMP0")) ,sum(Table[IMPRESSIONS]) )

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.