Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I wanted to know if anyone could help me with the following trouble I am having. I have a matrix visual and I want to show a column with a measure as a total only without respective values.
Here's an example data set
I created a matrix visual as follows,
From here I want to show, for a given Item Code, across companies, the highest value and the lowest value and what is the percentage difference.
I made the following measure and added to the matrix
Here, on the total column, it's giving me the figures I want i.e. for C1 Max is 16.3, min is 15.2 and difference is 7%. However, it's adding additional columns for each company. Any way I could get rid of this and show only the total column??
Solved! Go to Solution.
Hi @Imrans123 ,
According to your formula, in a measure, MAX and MIN will return the current value according to context, not the max or min value of the column, for example the Difference marked by the red line calculate by your formula is (12.2-12.2)/12.2=0.
You can get a better understanding of context through this article:Context in DAX Formulas
Here's my solution.
Difference =
VAR _MAX =
MAXX (
FILTER ( ALL ( Sheet1 ), 'Sheet1'[Item Code] = MAX ( 'Sheet1'[Item Code] ) ),
'Sheet1'[Price]
)
VAR _MIN =
MINX (
FILTER ( ALL ( Sheet1 ), 'Sheet1'[Item Code] = MAX ( 'Sheet1'[Item Code] ) ),
'Sheet1'[Price]
)
RETURN
DIVIDE ( _MAX - _MIN, _MIN )
Get the result.
Reference for MAXX and MINX function: MAXX function (DAX) - DAX | Microsoft Docs
MINX function (DAX) - DAX | Microsoft Docs
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I'm facing the same issue and wondering if there is a way to not show these extra columns added to matrix as show in below in the yellow and only show the column added after the Total column in Green?
Any help would be greatly appreciated!
Thanks,
Ali
Hello Team,
I'm facing the same issue and wondering if there is a way to not show these extra columns added to matrix as show in below in the yellow and only show the column added after the Total column in Green?
Any help would be greatly appreciated!
Thanks,
Ali
Hi @Imrans123 ,
According to your formula, in a measure, MAX and MIN will return the current value according to context, not the max or min value of the column, for example the Difference marked by the red line calculate by your formula is (12.2-12.2)/12.2=0.
You can get a better understanding of context through this article:Context in DAX Formulas
Here's my solution.
Difference =
VAR _MAX =
MAXX (
FILTER ( ALL ( Sheet1 ), 'Sheet1'[Item Code] = MAX ( 'Sheet1'[Item Code] ) ),
'Sheet1'[Price]
)
VAR _MIN =
MINX (
FILTER ( ALL ( Sheet1 ), 'Sheet1'[Item Code] = MAX ( 'Sheet1'[Item Code] ) ),
'Sheet1'[Price]
)
RETURN
DIVIDE ( _MAX - _MIN, _MIN )
Get the result.
Reference for MAXX and MINX function: MAXX function (DAX) - DAX | Microsoft Docs
MINX function (DAX) - DAX | Microsoft Docs
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
It's not too hard to write a measure that returns blank for each company column using ISINSCOPE, but that won't make them disappear (they'll just be blank instead of 0.00).
A quick and dirty solution is to turn off word wrap and resize the columns to be effectively invisible.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
96 | |
75 | |
63 | |
62 |
User | Count |
---|---|
135 | |
105 | |
104 | |
80 | |
65 |