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

What and how to use an aggregate function?

I need to create a measure and it have to use an aggregation

8 REPLIES 8
Sean
Community Champion
Community Champion

You most likely need to add SUM to the Measure you are trying to create...

 

But you need to explain a bit more - what are you trying to do???

Anonymous
Not applicable

In my need to calculate a measured value in which I will have to use the IF function, and aggregation would be applied to the fields from other tables, for example:

 

Measured = sum (AGGR (if (table.column = '9 - Deductions from Revenue', sum (table.Vl_Receita) + sum (table.Vl_Estorno), sum (table.Vl_Receita) - sum (table.Vl_Estorno)) [Desc Group Revenue], Nível01, year, month))

Sean
Community Champion
Community Champion

You have to explain what you are trying to do and what the data looks like.

 

This is neither DAX nor M.

Anonymous
Not applicable

I need to create a measure for a given one cauculo value is made by adding two fields and the rest is made another calculation is independent of the value after the value is added for three other fields.


trying to give an example:


sum (Aggregation (If (table.column = 'a' then sum (table.columnA) + sum (table.columnB) else sum (table.columnA) - sum (table.columnB)), ColumnC, ColumnD, ColumnE)

Anonymous
Not applicable

Hi @Anonymous,

 

   are you searching for something like this?

 

calculateAggregateFunction.png

 

I've divided your problem into two functions.

Let me know if it works and if it's what are you searching for.

 

#I'M Not An Expert#

Anonymous
Not applicable

And @Anonymous have not yet found a role in Power BI that do the same thing AGGR or Agregate function, only noting that the purpose of this function is:

returns a calculated expression values indicated on the size and dimensions.

Anonymous
Not applicable

@Anonymous I simply gave you my solution, I'm not an expert and I still have a lot of things to learn.

So it's better that you ask to someone else.

Anonymous
Not applicable

@ B129 this solution solves half of my problem in my case I will use this measure in graphs and also in tables and often I will not add the column that I am on the chart ortable that I am applying as far as your example Column which brings the value "a".

I will do some testing but I still have to more acrescertar something far.

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.