Questions tagged [dax]

Expression language used in Microsoft Power Pivot, Analysis Services, and Power BI for performing analytical calculations.

DAX stands for Data Analysis eXpressions, an expression language created by Microsoft for performing custom analytical calculations within the Power Pivot add-in for Excel, Analysis Services, and Power BI.

DAX functions work on a column or table level to make use of the underlying compression technology used in PowerPivot.

Expressions created in DAX can be used in several ways:

  1. In calculated columns, evaluating the function on a row-by-row basis over an entire table.
  2. In measures, which may be manipulated and aggregated differently, depending on context.
  3. To return a tabular resultset when a table expression is evaluated (fills role of a general purpose query language)
  4. To create a calculated table in a Power BI model as part of the modelling process

Useful Links

8483 questions
1
vote
1 answer

Change rows for matrix using radio buttons (DAX) in PowerBI

How or if is it possible to change rows for matrix using radio buttons (DAX). In this image it would be Category. It is possible to calculate sums based on filters provided by calculated metrics. I can't figure out how to change rows with DAX and am…
ram4nd
  • 456
  • 1
  • 5
  • 19
1
vote
0 answers

How to create a difference between columns in Matrix regardless of whether the periods are consecutive or not

This is data set: Data Set And this is the output table: Matrix This tables be accomplished by creating a matrix with the following options: Rows = Type Columns Year & Period Values: sum(value) In order need to create the column (diff1) that shows…
mnsen
  • 11
  • 1
1
vote
1 answer

Filtering using variables and IN

In R I can write neighbours<-c("Merton", "Southwark","Sutton","Wandsworth", "Bromley") And then filter a dataframe like df %>% filter(neighbours %in% boroughs_of_london) And it can get even more complex if you follow…
damo
  • 463
  • 4
  • 14
1
vote
1 answer

Wildcard search in the IN operator

I am trying to create a measure : Currently I have: a_measure = CALCULATE(SUM(table[Count]), table[status] IN {"Duplicate","Returned - 10+ Days", "Returned - Inappropriate"} ) table is my table table[Count] is a helper column which has the value…
damo
  • 463
  • 4
  • 14
1
vote
1 answer

Matching dates with weekdays, PowerBI

I have 2 tables, AvailabilitiesDB and AvailabilityTemplateDB. The AvailabilitiesDB table looks like like IsAvailable StartTime FinishTime Employee_ID Week Day Of the Week …
EmilL
  • 62
  • 7
1
vote
0 answers

Excel Power Query to check duplicates in large datasets

So in a nutshell the problem is, that I have 3.0 million of different itemIDs in one dataset (CSV for example) and 1.0 million itemIDs in another dataset. What would be the most convenient way to find out all of the duplicates? In basic excel it…
chessBoy
  • 11
  • 1
1
vote
0 answers

Dynamic Categorization Based on Averages

I am trying to categorize students based on score averages in Power BI but have run into lots of issues. I would like be able to categorize the averages into buckets depending on what filters are applied to the date. For example, if I filter on two…
M.D
  • 38
  • 1
  • 6
1
vote
2 answers

DAX Filter context

I am wondering what the difference is between these two DAX expressions which each return what I need: (1) =calculate([PctMkt], FILTER ( ALL ( BondDim), BondDim[Quality] = "HY" )) (2) =calculate([PctMkt], ALL(BondDim), BondDim[Quality] = "HY"…
Wadstk
  • 175
  • 3
  • 12
1
vote
1 answer

Power BI calculate sum only last value of duplicate ID

I'm struggling to create a Measure that sums a column and have it filter out duplicate IDs while taking only the latest row. For example, there is a table as such: UID | Quantity | Status | StatusDate aaa | 3 | Shipped | 11/1/2020 aaa |…
skiyono
  • 11
  • 4
1
vote
3 answers

DAX TOP 1 COUNT of GROUPBY

I want to have a Card in Power BI with the result of the select SELECT TOP 1 [COLUMN] FROM [Table] GROUP BY [COLUMN] ORDER BY COUNT([COLUMN]) DESC How can I do something like this in dax?
Mac
  • 21
  • 5
1
vote
2 answers

DAX - Get list from a filtered SUMMARIZE formula

So, I have the following tables in my Power BI : Sales : Date | ID_Client | ID_Product | Amount Client : ID_Client | Name_Client I would like to get the number of unique BIG clients in any given month. I therefore use the following formula (which I…
Carto_
  • 577
  • 8
  • 28
1
vote
1 answer

Last Year vs Current Selected Year

I have been creating a dashboard in which I am trying to showing current Selected year vs last year analysis. Please see the below image : As you see in the above image, 2020 year selected from the slicer and 2020 sales is 4.30M. Expectation : I…
Mudi
  • 95
  • 1
  • 2
  • 13
1
vote
1 answer

DAX for rolling seven day average to pivot chart by year

I'm trying to create a single pivot chart that will show separate years of data on the same date axis for a rolling 7-day average. So, the x-axis will be text, 01-Jan to 31-Dec, and each year will be a separate series: It has to be a text x-axis,…
Phil T
  • 67
  • 7
1
vote
1 answer

Top 2 by group in DAX Power BI

I am trying to get the Top 2 units by company here. Table is called 'Table (3)' I want to be able to populate the column like this - I had tried Column = RANKX(ALLEXCEPT('Table (3)','Table (3)'[Company]),SUM('Table (3)'[Units])) but got a…
Peter Hui
  • 119
  • 2
  • 9
1
vote
1 answer

How to create following formula Excel in Power BI and what does -100% mean in Excel formula?

This might be something simple, but I am confused. Can anybody please tell me what does this -100% in excel formula is doing? I try to dig through online, it just points to me for meaning.  =(8.7/8.9)-100% I am trying to create the exact same…
Suneth
  • 199
  • 1
  • 3
  • 13
1 2 3
99
100