Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
I am little new to Power BI and am finding little difficulty in understanding some concepts.
I was working - Highlighting max bars.
I am applied this logic -
Solved! Go to Solution.
Hi,
I am not sure how your semantic model looks like, but please try something like below.
I think it needs context transition in the measure.
Maximum Value =
VAR MaxVal =
MAXX ( ALL ( 'table' ), CALCULATE ( SUM ( 'table'[column] ) ) ) //need context transition and CALCULATE function enables context transition
VAR Color =
IF ( SUM ( 'table'[column] ) = MaxVal, "Dark Blue", "Grey" )
RETURN
Color
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi @BHAVIKCHAWLA ,
Thanks @Jihwan_Kim for sharing, I have an addition here:
Allexcept() function:
1. Removes all context filters in the table except filters that have been applied to the specified columns.
2. Functions for grouping
Here are other function recommendations you might consider using the all() and allselected() functions:
All():
Returns all the rows in a table, or all the values in a column, ignoring any filters that might have been applied. This function is useful for clearing filters and creating calculations on all the rows in a table.
ALL function (DAX) - DAX | Microsoft Learn
Allselected():
Removes context filters from columns and rows in the current query, while retaining all other context filters or explicit filters.
ALLSELECTED function (DAX) - DAX | Microsoft Learn
If you want to find the maximum value of each grouping after removing all filters, you can try the following dax:
Measure =
MAXX(FILTER(ALL('Table'),'Table'[column]=MAX('Table'[column])),[Value])
If you want to find the maximum value of each grouping as Visual changes, you can try the following dax:
Group_Allselect =
MAXX(FILTER(ALLSELECTED('Table'),'Table'[column]=MAX('Table'[column])),[Value])
If you want to find the maximum value for the whole table after removing all filters, you can try the following dax:
Max_All =
MAXX(ALL('Table'),'Table'[Value])
If you want to find the maximum value for the whole table as Visual changes, you can try the following dax:
Max_Allselected =
MAXX(ALLSELECTED('Table'),'Table'[Value])
This is the data from the original table:
This is the result of measure:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
I am not sure how your semantic model looks like, but please try something like below.
I think it needs context transition in the measure.
Maximum Value =
VAR MaxVal =
MAXX ( ALL ( 'table' ), CALCULATE ( SUM ( 'table'[column] ) ) ) //need context transition and CALCULATE function enables context transition
VAR Color =
IF ( SUM ( 'table'[column] ) = MaxVal, "Dark Blue", "Grey" )
RETURN
Color
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
13 | |
11 | |
10 | |
7 | |
7 |
User | Count |
---|---|
13 | |
12 | |
12 | |
9 | |
8 |