Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Imrans123
Advocate V
Advocate V

Showing a Measure as a Total Column only on Matrix

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

 

PBI Community.PNG

 

I created a matrix visual as follows, 

PBI Community 2.PNG

 

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 

Difference = (MAX(Sheet1[Price ])-MIN(Sheet1[Price ]))/MIN(Sheet1[Price ])
 
PBI Comm 3.PNG

 

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??

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

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.

vkalyjmsft_0-1642664776327.png

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.

vkalyjmsft_1-1642665442863.png

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.

 

 

View solution in original post

4 REPLIES 4
Ali-Analyst
Frequent Visitor

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?

AliAnalyst_0-1686782719708.png

AliAnalyst_3-1686782788168.png

 

Any help would be greatly appreciated!

Thanks,

Ali

Ali-Analyst
Frequent Visitor

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?

AliAnalyst_0-1686782334009.png

AliAnalyst_1-1686782543459.png

Any help would be greatly appreciated!

Thanks,

Ali

v-yanjiang-msft
Community Support
Community Support

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.

vkalyjmsft_0-1642664776327.png

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.

vkalyjmsft_1-1642665442863.png

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.

 

 

AlexisOlson
Super User
Super User

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.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.