In this Microsoft Power BI tutorial, I have explained how to filter the max date value using the Power BI DAX Max function and also, and we will see how to display the maximum difference in days using Power bi DAX. I will also show you various examples of Power bi Max Date functions in Power BI.
I recently worked on a Power Bi report, where I got a requirement to filter the table data values based on the maximum date value using the Power BI Max function.
- Power BI DAX max date
- Power BI DAX max difference today
- Power BI DAX max difference in days
- Power BI DAX max not working
- Power BI DAX Second max date
- Power BI DAX returns max date
- Power BI DAX max date group by
- Power BI DAX filter max date
- Power BI DAX max date add
- Power BI DAX max distinct
- Power BI DAX calculates the max date
- Power BI DAX summarizes max date
- Power BI DAX max date add month
- Power BI DAX lookup value max date
- Power BI DAX max difference
- Power BI DAX max DateTime
- Power BI DAX max not null
- Power BI DAX max day of the month
- Power BI DAX max dd/mm/yy
- Power BI DAX max not showing
- Power BI DAX max non-blank value
- Power BI DAX max n months
Power BI DAX max date
Let us see how we can calculate the maximum date using Power Bi max function in Power Bi.
In this example, we will calculate the maximum date for the release date column in the car table and display the latest car price value in the card visual.
The Power BI MAX function takes a column or two expressions as an argument and returns the largest value.
Power Bi Syntax for Maximum function:
MAX(<column>)
- Open the Power Bi desktop, and load the data into the desktop. Select the new measure option from the ribbon under the Home tab and apply the below-mentioned formula.
Latest Car Price =
var Maxdate =MAX (Cars[Released Date]) var latestcar = CALCULATE(SUM(Cars[Price]),Cars[Released Date] = Maxdate)
return latestcar
Where,
- Latest Car Price = New Measure name
- Cars = Table Name
- Released Date = Existing column name
- Max date, latest car = Variable name
- Now in the report section, select the table visual and card visual. In the table visually drag and drop the car name, car price, and released date value from the field pane.
- And in the card visual drag and drop the Created measure value to display the maximum price value based on the condition applied.
- The screenshot below displays the car price value in the card visual for the maximum car based on the released date column.
This is how to calculate the maximum date using Power Bi max function in Power Bi.
Power BI DAX max difference today
Here we will see how to calculate the difference value using the power bi DAX function in Power Bi.
In this example, we will calculate the day’s difference count value between two date values called today and the car release date.
- Open the Power Bi desktop, and load the data into the desktop. Select the new column option from the ribbon under the Home tab and apply the below-mentioned formula.
Difference today value = INT(TODAY() - Cars[Released Date])
Where,
- Difference today value = New Column name
- Cars = Table Name
- Released Date = Existing column name
- Today = Function name
In the below screenshot, you can see that the new column has been added and displayed the difference value count based on today’s condition applied between two dates.
This is how to calculate the difference value between two dates using the power bi DAX function in Power Bi.
Also Read: Power bi Dax Today() Function [With real examples]
Power BI DAX max not working
- No, the Power Bi Dax Max function works when we follow the correct syntax of the Max function. The Power Bi Max function syntax is MAX(<column>).
- You can also check out the Power Bi Max function tutorial which helps you to calculate the Maximum value in Power Bi.
Power BI DAX max difference in days
Let us see how to find the max difference in days using the Power BI Dax Max function in Power BI.
In this example, we will calculate the maximum difference in days count value based on the car release date.
- Open the Power Bi desktop, and load the data into the desktop. Select the new column option from the ribbon under the Home tab and apply the below-mentioned formula.
Maximum difference Days = INT(TODAY() - MAX(Cars[Released Date]))
Where,
- Maximum difference Days = New Column name
- Cars = Table Name
- Released Date = Existing column name
- Today = Function name
- In the below screenshot, you can see that the new column has been added and displayed the different day’s count value for the Maximum release date.
- In the Released Date column, the maximum date is 29/11/2022 whereas the current date is 06/12/2022. So the new column will display the difference value based on the maximum released date value as highlighted below:
This is how to find the max difference in days using the Power BI Dax Max function in Power BI.
Check out: Power BI DAX Filter Table [With Real Examples]
Power BI DAX Second max date
Here we will see how to find the second max date value from the data table using the Power Bi Dax Max function in Power BI.
In this example, we will calculate the second maximum date for the car release date column presented in the data table.
- Open the Power Bi desktop, and load the data into the desktop. Select the new measure option and apply the below-mentioned formula.
Second max date =
VAR maxdate =
CALCULATE ( MAX ( Cars[Released Date] ), ALLSELECTED ( 'Cars' ) )
RETURN
CALCULATE (
MAX ( 'Cars'[Released Date] ),
FILTER ( ALL ( 'Cars' ), 'Cars'[Released Date] < maxdate )
)
Where,
- Second max date = New measure name
- Cars = Table Name
- Released Date = Existing column name
- Now in the report section, select the table visual and card visual. In the table visually drag and drop the car name, car price, and released date value from the field pane.
- And in the card visual drag and drop the Created measure value to display the second maximum date value based on the condition applied.
- The screenshot below displays the second maximum date value in the card visual for the release date column.
This is how to find the second max date value from the data table using the Power Bi Dax Max function in Power BI.
Have a look: How To Remove Filter From Power BI DAX
Power BI DAX returns max date
Here we will calculate the maximum date and return the maximum date value using Power Bi max function in Power Bi.
Now in this example, we will calculate and return the maximum date value using the Max function in Power bi.
- Open the Power Bi desktop, and load the data into the desktop. Select the new column option from the ribbon under the Home tab and apply the below-mentioned formula.
MaxDate = CALCULATE(MAX(Cars[Released Date]),FILTER(Cars,Cars[Released Date]= MAX(Cars[Released Date])))
Where,
- MaxDate = New Column name
- Cars = Table Name
- Released Date = Existing column name
In the below screenshot, you can see that the new column has been added and returned the max date value of the car released date column presented in the data table.
This is how to calculate the maximum date and return the maximum date value using Power Bi max function in Power Bi.
Power BI DAX max date group by
Here we will calculate the maximum date and return the maximum date value using Power Bi Group by and max functions in Power Bi.
In the example, we will calculate the maximum date value using Power Bi group by function to group the values.
- Open the Power Bi desktop, and load the data into the desktop. Select the new measure option from the ribbon under the Home tab and apply the below-mentioned formula.
CarReleasedDate_Earliest =
VAR GroupBy_CarNames = GROUPBY(Cars,Cars[Car Names])
RETURN
MAX(Cars[Released Date])
Where,
- CarReleasedDate_Earliest = New Measure name
- GroupBy_CarNames = Variable Name
- Cars = Table Name
- Released Date, Car Names = Existing column names
- Now in the report section, select the table visual and card visual. In the table visually drag and drop the car name, car price, and released date value from the field pane.
- And in the card visual drag and drop the Created measure value to display the maximum date value based on the Group by condition applied.
- In the below screenshot, you can see that the card visually displays the max date value of the car and groups the car names by using the Group by function and displays the maximum value.
This is how to calculate the maximum date and return the maximum date value using Power Bi Group by and max functions in Power Bi.
Power BI DAX filter max date
Let us see how to filter and find the max date values using the Power BI Dax filter Max function in Power BI.
In this example, we will compare and calculate the maximum date value based on the car release date.
- Open the Power Bi desktop, and load the data into the desktop. Select the new column option from the ribbon under the Home tab and apply the below-mentioned formula.
Filter Max date = CALCULATE(MAX(Cars[Released Date]),FILTER(Cars,Cars[Car Names]="Ford"))
Where,
- Filter Max date = New column name
- Cars = Table Name
- Released Date, Car Names = Existing column names
In the below screenshot, you can see that I have filtered the date value only for the car name called Ford, So it will compare all the date value for the mentioned car value and returns the max value.
This is how to filter and find the max date values using the Power BI Dax Max function in Power BI.
Read: How to Filter Blank Value in Power BI
Power BI DAX max date add
- It is not possible to filter the max date value using the Power Bi Date Add function in Power Bi.
- Because the dates values in Power Bi DateAdd() function needs a column, whereas the Power Bi Max() function returns aggregated values.
- It’s not supported to use MAX() function in DateAdd() function as the dates feature.
Power BI DAX max distinct
Let us see how to filter and find the max date distinct values using the Power BI Dax distinct function in Power BI.
In this example, we will calculate the maximum distinct date value count based on the car release date.
- Open the Power Bi desktop, and load the data into the desktop. Select the new column option from the ribbon under the Home tab and apply the below-mentioned formula.
Distinct Count = CALCULATE(DISTINCTCOUNT(Cars[Released Date]))
Where,
- Distinct Count = New column name
- Cars = Table Name
- Released Date = Existing column names
In the below screenshot, we can see that the new distinct count column displays the value as 1 because all the dates are presented in the release date column, where all the dates are unique date values, and no repeated or duplicate dates are presented in it.
This is how to filter and find the max date distinct values using the Power BI Dax function in Power BI.
Check Post: Power BI DAX Filter If [With Real Examples]
Power BI DAX calculates the max date
Let us see how we can calculate the maximum date using Power Bi Calculate Max function in Power Bi.
In this example, we will calculate the maximum date for the release date column in the car table and display the latest car price value in the card visual.
- Open the Power Bi desktop, and load the data into the desktop. Select the new measure option from the ribbon under the Home tab and apply the below-mentioned formula.
Car Price value=
var Maxdate =MAX (Cars[Released Date]) var latestcar = CALCULATE(SUM(Cars[Price]),Cars[Released Date] = Maxdate)
return latestcar
Where,
- Car Price value = New Measure name
- Cars = Table Name
- Released Date = Existing column name
- Max date, latest car = Variable names
- Now in the report section, select the table visual and card visual. In the table visually drag and drop the car name, car price, and released date value from the field pane.
- And in the card visual drag and drop the Created measure value to display the maximum price value based on the condition applied.
- The screenshot below displays the car price value in the card visual for the maximum car based on the released date column.
This is how to calculate the maximum date using Power Bi max and calculate the function in Power Bi.
Read Post: Power Query Add Column Date [15 Examples]
Power BI DAX summarizes max date
Let us see how we can use the Power Bi Dax Max function to summarize the maximum date value in Power BI.
In this example, we use the Power BI Dax summarize function and calculate the maximum date value and display them in the new column in a table.
- Open the Power Bi desktop, and load the data into the desktop. Select the new column option from the ribbon under the Home tab and apply the below-mentioned formula.
TopDate =
Var MDate = SUMMARIZE (
'Cars',Cars[Car Names],
"MaxDate", MAX ( 'Cars'[Released Date])) return MAX(Cars[Released Date])
Where,
- Top Date = New column name
- MDate = Variable name
- Cars = Table Name
- Released Date = Existing column names
In the below screenshot, we can see that the new column summarizes and displays the maximum date value in the table.
This is how to calculate the Power Bi Dax Max function to summarize the maximum date value in Power BI.
Power BI DAX max date add month
Let us see how we can find and add the maximum monthly value using the Power Bi Max function in Power BI.
In this example, we will create two columns called Month and Max Month to add the Max month value. In the Month column, we will separate the month values from the date column. In the same way, we will add the Max Month value in the Max Month Column.
- Open the Power Bi desktop, and load the data into the desktop. Select the new column option from the ribbon under the Home tab and apply the below-mentioned formula.
Month = MONTH('Cars'[Released Date])
Where,
- Month = New column name
- Released Date = Existing Column name
In the below screenshot, we can see it splits the month value from the released date column and displayed them in the month column:
- In the same way, to add month value, Select the new column option from the ribbon under the Home tab and apply the below-mentioned formula.
Max Month Value = MAX(Cars[Month])
Where,
- Max Month Value = New column name
- Released Date, Cars[Month] = Existing Column name
In the below screenshot, we can see it splits the month value from the released date column and displayed them in the month column:
This is how to find and add the maximum monthly value using the Power Bi Max function in Power BI.
Also Check: Power Query Add Column If Statement
Power BI DAX lookup value max date
Let us see how we can find the Power Bi Dax Max date value using the power bi Dax LookUp function in Power BI.
In this example, we use the Power BI Dax lookup function and calculate the maximum date value and display the result value in a new column in the table.
- Open the Power Bi desktop, and load the data into the desktop. Select the new column option from the ribbon under the Home tab and apply the below-mentioned formula.
MAXDATE =
VAR MaxDate =
LOOKUPVALUE (Cars[Released Date],Cars[Car Names],MAX(Cars[Released Date]))
RETURN
MAX(Cars[Released Date])
Where,
- MAXDATE = New column name
- MaxDate = Variable name
- Cars = Table Name
- Released Date, Car Names = Existing column names
In the below screenshot, we can see that the new column displays the maximum date value in the table based on the applied condition.
This is how to find the Power Bi Dax Max date value using the power bi Dax LookUp function in Power BI.
Power BI DAX max difference
Here we will see how to calculate the difference value using the power bi DAX function in Power Bi.
In this example, we will calculate the maximum difference count value between two date values called the car planned sales date and the car release date.
- Open the Power Bi desktop, and load the data into the desktop. Select the new column option from the ribbon under the Home tab and apply the below-mentioned formula.
Max Difference = INT(Cars[Planned Sale Date]-Cars[Released Date])
Where,
- Max Difference = New Column name
- Cars = Table Name
- Released Date, Planned Sale Date = Existing column name
In the below screenshot, you can see that the new column has been added and displayed the difference value count based on the condition applied between the two dates.
This is how to calculate the difference value between two dates using the power bi DAX function in Power Bi.
Power BI DAX max DateTime
Let us see how to display the maximum date value along with the time using the Power BI Dax function in Power BI
In this example, we will create two columns to calculate the max DateTime value using the Power Bi Max function in Power Bi.
- Open the Power Bi desktop, and load the data into the desktop. Select the new column option and apply the below-mentioned formula.
YearMonth = Year(Cars[Released Date]) * 100 = Month (Cars[Released Date])
Where,
- YearMonth = New Column name
- Cars = Table Name
- Released Date = Existing column name
- In the same way, create another column and apply the below formula to calculate the earliest value.
MaxDate = CALCULATE(MAX(Cars[Released Date]),FILTER(Cars,[YearMonth]=EARLIER(Cars[YearMonth])))
Where,
- MaxDate = New Column name
- Cars = Table Name
- Released Date = Existing column name
- Now in the report section, select the table visual and card visual. In the table visually drag and drop the car name, car price, and released date value from the field pane.
- And in the card visual drag and drop the Created measure value to display the earliest date value based on the condition applied.
- The screenshot below displays the earliest maximum date value in the card visual for the release date column.
This is how to find the earliest max date value from the data table using the Power Bi Dax Max function in Power BI.
Power BI DAX max not null
Let us see how to display the maximum not null value using the Power BI Dax Max function in Power BI
In this example, we will create a measured value and check that if the date column has no null value it displays a true value else it displays a false value using the Power Bi Max function in Power Bi.
- Open the Power Bi desktop, and load the data into the desktop. Select the new measure option and apply the below-mentioned formula.
Max value except if null = MAxx(Cars,IF(COUNTBLANK(Cars[Released Date]),False,True))
Where,
- Max value except if null = New measure name
- Cars = Table Name
- Released Date = Existing column name
- Now in the report section, select the table visual drag and drop the car name, car price, released date value, and also the created measure value from the field pane.
- The screenshot below displays that the release date column has not null value it displays a true value else it displays a false value.
This is how to display the maximum, not null value using the Power BI Dax Max function in Power BI.
Power BI DAX max day of the month
Let us see how to display the count of the max day of the month using the Power BI Dax function in Power BI
In this example, we will create a measured value and count the cars based on the max day of the month using the Power Bi Max function in Power Bi.
- Open the Power Bi desktop, and load the data into the desktop. Select the new measure option and apply the below-mentioned formula.
MaxCount =
CALCULATE (
COUNT (Cars[Car Names] ),
FILTER ( 'Cars', 'Cars'[Released Date] = MAX ( Cars[Released Date]) )
)
Where,
- MaxCount = New measure name
- Cars = Table Name
- Released Date = Existing column name
- Now in the report section, select the table visual drag and drop the car name, car price, released date value, and also the created measure value from the field pane.
- The screenshot below displays the count of the max day of the month based on the release date column:
This is how to display the count of the max day of the month using the Power BI Dax function in Power BI.
Power BI DAX max not showing
- Power Bi shows the correct max value when we follow the correct syntax of the Max function along with the Column value presented in a table. The Power Bi Max function syntax is MAX(<column>).
- You can also check out the Power Bi Max function tutorial which helps you to calculate the Maximum value or the largest value of the selected column in Power Bi.
Power BI DAX max dd/mm/yy
Here we will see how to format or change the date format to dd/mm/yy using the Power Bi Dax expression in Power Bi.
- Open the Power bi desktop, Load the data using get data, and click on the Modelling tab -> new column option. Then apply the below-mentioned DAX expression:
Format Date = FORMAT(Cars[Released Date],"DD/MM/YY")
Where,
- Format Date = New Column name
- Cars = Table Name
- Released Date = Existing column name
- DD/MM/YY = Date Format
The Existing Released date column is in the format of mm/dd/yyyy, where the newly formatted date value represents the value as dd/mm/yy as shown below:
This is how to format or change the date format to dd/mm/yy using the Power Bi Dax expression in Power Bi.
Power BI DAX max date months
Here we will see how to find the max date months and display the value using the Power Bi Dax Max function in Power BI.
In this example, we will display the car color value in the new column for the maximum date value presented in the data table.
- Open the Power Bi desktop, and load the data into the desktop. Select the new column option and apply the below-mentioned formula.
Max date months = MAXX(FILTER(ALL('Cars'), MONTH(Cars[Released Date].[MonthNo])= MONTH(MAX(Cars[Released Date].[MonthNo]))),[Color])
Where,
- Max date months = New Column name
- Cars = Table Name
- Released Date = Existing column name
The screenshot below displays a color value for the maximum date value presented in the data table.
This is how to find the max date months and display the value using the Power Bi Dax Max function in Power BI.
Furthermore, you may like some more Power BI tutorials:
- How to duplicate multiple columns using Power Query
- How to add an empty column in Power BI
- How to add a column with a dropdown list in Power Query
- How to add a column with the same value in Power BI
- How to add column from another table in Power BI [3 Different ways]
This Power BI tutorial explained how to easily calculate the Maximum date value from the table data using the Power Bi Dax Max function. Also, we covered these topics below:
- Power BI DAX max date
- Power BI DAX max difference today
- Power BI DAX max difference in days
- Power BI DAX Second max date
- Power BI DAX returns max date
- Power BI DAX max date group by
- Power BI DAX filter max date
- Power BI DAX max date add
- Power BI DAX max distinct
- Power BI DAX max difference
- Power BI DAX calculates the max date
- Power BI DAX summarizes max date
- Power BI DAX max date add month
- Power BI DAX lookup value max date
- Power BI DAX max not working
- Power BI DAX max DateTime
- Power BI DAX max not null
- Power BI DAX max day of the month
- Power BI DAX max dd/mm/yy
- Power BI DAX max not showing
- Power BI DAX max non-blank value
- Power BI DAX max n months
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com