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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Bakhtawar
Post Patron
Post Patron

dax example

i want examples of these points .. 

 

  • Any DAX function always refers to a complete column/field or a table. It will never refer to individual values. If you want to use the functions on separate values within a column, you need to apply filters in a DAX formula.
  • DAX functions provide the flexibility to create a formula that is applied on a row-by-row basis. The calculations or formulas get applied as per the context of the values in each row.

any example please?

 

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

So, an example of the first one, to get to an individual value of a cell you could do something like this:

 

Measure = MAXX(FILTER('Table',[Column] = "Something"),[Value])

 

This would filter the table "Table" to only the rows where "Column" equals the value "Something" and then return the maximum value in the Value column from that subset. Note, there are literally tens of thousands if not hundreds of thousands of examples that could be provided for this because it is how DAX works. It is a core concept and I include it in my book in the first chapter "Thinking DAX".

 

Correct, this would be a calculated column like:

New Column = [Column1] + [Column2]

 

Each row would take the value in Column1 and Column2 for that row and add them together into the new column, "New Column".

 

Or, in a measure, you can use ADDCOLUMNS and it's the same sort of thing.

 

 

 

 



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Hi @Bakhtawar ,

 

Here is the test data.

2-1.PNG

Then I created a measure:

Measure = 
SUM('Table'[Column3])

Now you could do see the different results with column1 and column2.

3-1.PNG

The measure will show different result depends on your context.

 

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

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

So, an example of the first one, to get to an individual value of a cell you could do something like this:

 

Measure = MAXX(FILTER('Table',[Column] = "Something"),[Value])

 

This would filter the table "Table" to only the rows where "Column" equals the value "Something" and then return the maximum value in the Value column from that subset. Note, there are literally tens of thousands if not hundreds of thousands of examples that could be provided for this because it is how DAX works. It is a core concept and I include it in my book in the first chapter "Thinking DAX".

 

Correct, this would be a calculated column like:

New Column = [Column1] + [Column2]

 

Each row would take the value in Column1 and Column2 for that row and add them together into the new column, "New Column".

 

Or, in a measure, you can use ADDCOLUMNS and it's the same sort of thing.

 

 

 

 



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

and second one ?

Hi @Bakhtawar ,

 

Here is the test data.

2-1.PNG

Then I created a measure:

Measure = 
SUM('Table'[Column3])

Now you could do see the different results with column1 and column2.

3-1.PNG

The measure will show different result depends on your context.

 

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

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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