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

Set First day of the range as Initial Inventory + Production - Sales = Inventory (DAX)

My challenge has been how to 01 - set Initial Inventory (considering the first day of the column); 02 - From the second day on, have Forecast (Previsão) - Sales (Vendas) = Balance. So 3 columns for each day The way it is now, it repeats Initial…
onit
  • 2,275
  • 11
  • 25
1
vote
1 answer

DAX: how to assign color hex code based on text value?

I am trying to change the color of a text column based on the text itself: VERY GOOD: green GOOD: light green FAIR: yellow BAD: orange VERY BAD: red I wrote the following DAX expression: RAG = VAR Category = SELECTEDVALUE('Data'[Text]) …
Zizzipupp
  • 1,301
  • 1
  • 11
  • 27
1
vote
1 answer

How does power bi resolve ambiguity when we use USERELATIONSHIP?

Suppose I have a date table that filters product and product history tables. And then I try to add a link between product and product history (m:m on the name column in both tables), then Power BI doesn't allow me to add an active link (Or make a…
variable
  • 8,262
  • 9
  • 95
  • 215
1
vote
0 answers

SSAS :Role Driven Security

I hope you are doing well. It's about Role Driven Dynamic Security. And I would like to have your opinion. I am working on a tabular model deployed on Azure Analysis Service. I need to implement role-based security rules. All security roles are…
Lidou123
  • 155
  • 3
  • 15
1
vote
1 answer

Power BI - Check if events are between two dates in related table

Let's say I have a table of projects and their associated companies, dates, and costs: Project IDs are unique, but one company can have multiple projects. This table is linked (many to one) with a "Company" table: Which is then linked (one to…
yaxx0r
  • 149
  • 3
  • 15
1
vote
0 answers

Errors with DateDiff between two calculated columns in PowerBi

I work for an FI and need tips on creating a measure that will allow me to find the days between when a transaction takes an account negative and when the next deposit takes the account positive. Right now we have identified the negative and…
1
vote
1 answer

Tips to sum values and ignore all filter but the fields of two table in Dax?

I have 3 dimensions tables and one fact Table Sales DimCalendar (Fields Year/Month/Day/Week) DimCountry (Field : CountryName) DimManager (Field ManagerName) FctSales (Field : Amount) I want to create a measure to Sum the Amount of the Sales…
MoonLightFlower
  • 173
  • 1
  • 14
1
vote
1 answer

Calculate and show % of total of 1 category in powerbi

Please can you assist, I have a demographic table in power bi and I am required to only show the % of the total for 1 of those demographics , below is the table view I require. I have included a data sample, I would just pivot that/use a matrix, and…
1
vote
1 answer

How does ALL (tablename/columnname) work when used as 2nd parameter of CALCULATE?

The model has sales fact and product dimension. There is M:1 relationship on product_id column. Assume there is a table visual with 2 columns: Product name and a measure. Following are 2 sub-questions - Question regarding measure 1: Measure 1…
variable
  • 8,262
  • 9
  • 95
  • 215
1
vote
1 answer

Power Bi forecast projected sales accross days / months between a date range

I am trying to create a monthly forecast for a list of clients that have different start and end dates for their spending. I am able to create a formula that would work in excel, but am learning Power Bi and having troubles converting the formula to…
Sellmetv 2
  • 11
  • 2
1
vote
0 answers

ratio goes beyond 100%

I have a measure " realiseret ratios %". It calculates the allocation of cost in % but when I filter out some variables like 105 in left column then it recalculates the ratio and i goes beyond 100%. the ratio market with red must never surpass 100%.…
1
vote
2 answers

DAX Creating a New Table from an Old Table

I have a table named "Table 1" that looks like this: col_1 col_2 steve smith steve john linda jones johnny apple linda jones I want to create a new table that contains only distinct values of those 2 columns, so final result…
1
vote
1 answer

Hide a visual until slicers are selected in power BI

I want to display values on the table visual only when 3 of the slicers are selected or else no values should be displayed. For this, I did : IF(ISFILTERED(Table[Country]),IF(ISFILTERED(Table[Procurement…
coder_bg
  • 340
  • 6
  • 20
1
vote
1 answer

Creating an Index Column for a Descriptive Data Using “DAX” in Power BI

I have a table Like this, Table1 I want to create a column called as Row Number using DAX and not Query Editor (M). So the Expected output is, This can be done in M - Power Query Side. But, I am looking for a solution using DAX- Calculated…
johon
  • 65
  • 3
  • 12
1
vote
1 answer

Is there a method to prevent PowerBI visual displaying results when record count is under 5?

I have a real world problem that has me stumped. I have a powerBI report that is list of employee survey answers. Before I share it with the firm, I need to make sure that no individual can be identified by simply playing with the slicers…
Milan
  • 33
  • 6