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

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.

Reply
3L
Frequent Visitor

Percentage of filtered data by row in a matrix table

Hi,

 

I'm new to PBI/DAX and still trying to wrap my head around some concepts, please be understanding.

 

I have a set of weekly data and a matrix table to display it. The table is comprised by rows with dates, columns with a category of the data, and three subcolumns with value, weight % of total row unfiltered, and weight % of total row filtered.

 

I have some filters that I'm able to play around with slicers on the page, simple stuff, but I also have a slicer and parameter for the category of data that goes into the column of the matrix. That way I'm able to select the category that goes into the matrix columns.

 

The issue is, I can't seem to get the Weight (% of Filtered) correct due to the slicer of the parameter. See below:

 

3L_0-1696540637234.png

 

The measure I'm using

 

z_Weight (%Filtered) =
VAR BaseMeasure = SUM('Source_Table'[Value])
VAR Parameter_Selected =
    SUMMARIZE ( 'X_Parameter',
                'X_Parameter'[X_Categorization]
                )
RETURN
DIVIDE(
    BaseMeasure,
    CALCULATE(BaseMeasure, ALLEXCEPT('Source_Table',
        'Source_Table'[Date],
        'Source_Table'[Category 1],
        'Source_Table'[Category 2],
        'Source_Table'[Category 3]
    ))
)
 
I'm only able to get the proper percentage weight if I manually exclude the 'Source_Table'[Category X] that is being chosen by the slicer parameter for the column.
 
The way I see it is that the ALLEXCEPT should be filtering out the selected parameter in order to compute the full value of each row so that then it can calculate the weight of each column in the row. But I'm strugling to find a way to do this.
 
Please let me know if this is clear, appreciate any help I can get, happy to provide further clarifications.
 
Many thanks in advance.
1 REPLY 1
3L
Frequent Visitor

To make it easier to understand, I have created a simple PBIX file. Please see attached: WeTransfer PBIX link 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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