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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
bigsol84
Helper I
Helper I

calculate figures

Hello,

 

any help appreciated 🙂

 

i want to add figures up via dax but the issue is that the figures were broken down using a calculated column. from the orignal spreadsheet there was no age column and so i added one as the user wanted a breakdown via adults (and Unknown) and young people. You can see via the 3 boxes that i was able to get duration for adults (and Unknown) and young people by adding the calcuated column to the filter.  is there a way that i can calculate duration of adults and young people without the calculated column? So i want a measure to add up young people duration, then measure for adults duration and then add those two to get final total? so i want to be able to total up 5923.9 + 296.4 = 622031 but not via the calculated column if poss

 

Goyp_Adu2 = IF('GO Atten Reg'[Age] = 0 || ISBLANK('GO Atten Reg'[Age]), "Unknown", IF('GO Atten Reg'[Age] <19, "Young People", IF('GO Atten Reg'[Age] >18, "Adult")))
 
 

 

image1.JPGimage2.JPG

7 REPLIES 7
Greg_Deckler
Community Champion
Community Champion

@bigsol84 You could add the column in the measure using ADDCOLUMNS and then use SUMMARIZE or GROUPBY to group and sum them and the SUMX across that table to add them up.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler 

 

appreciate the post. Im still new to power bi and i understand what you have mention but could you show me how the dax formula will be written? Ive looked at youtube and some forums but getting my formula wrong.

 

Kind Regards 

 

 

@Greg_Deckler 

 

would the formula be something like this:

 

ADDCOLUMNS(
    SUMMARIZE( <table>, <group by column> ),
    <column_name>, CALCULATE( <expression> ), SUMX(.....
)

@bigsol84 I was thinking:

SUMX(

  SUMMARIZE(

    ADDCOLUMNS(

    )

  )

)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

 

Thanks - i will have another try and will let you know how i get on

@Greg_Deckler 

 

ive tried a few things and looked at various online things. when i make the formula am i expressing the different age groups first then adding up the duration?

 

Thanks 

@Greg_Deckler 

 

overallduration = ADDCOLUMNS(SUMMARIZE('GO Atten Reg','GO Atten Reg'[Duration (hrs)],'GO Atten Reg'[Age],'GO Atten Reg'[Goyp_Adu2],"Total Duration", IF('GO Atten Reg'[Age] <19, "Young Person",If('GO Atten Reg'[Age] >19,"Adult","Unknown"))))

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.