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
bcreed2
Regular Visitor

Dynamic Binning and Measures

I'm brand new to this software.  I'm not seeking an answer per se, but rather hoping you all can point me in the right direction,  As I understand it, what I'm trying to accomplish within PowerBI isn't neceassrily simple. 

 

I have an application level data set that contains information used to gauge the performance of several scorecards.  I'm able to obtain the metrics used to assess scorecard performance at the highest level.  In other words, the measures are calculated off of the entire data set.  

 

What I want to is have the table (shown below) show the various calculations with respect to the selections made in various filters.  For example, If a user selects "Credit Card" the calculations shown will then only be based on the credit card sub-set of my aggregated data set.  I'd also like the binning to automatically reparamaterize itself based on the user filter selections.  If anyone can tell me what I need to understand and what functions in DAX will be needed to do so it'd be greatly apprecaited! 

Capture.JPG

 

 

 

 

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @bcreed2,

 

As it is not supported to dynamically change column fields displayed on table visual depend on slicer selection, there is no direct solution to achieve your requirement.

 

Here are two workarounds just for your reference which might not meet your requirement exactly.

 

Unpivot table first. Select both [Product] and [Sub-Product] fields then, click the "Unpivot columns" button.

1.PNG2.PNG

 

Then, drag [type] field into slicer and place the other two into table visual.

3.PNG4.PNG

 

In that case, table's structure is changed which might affect some mesaures calculation.

 

Alternatively, you can create an extra table which lists all available slicer selections like below.

5.PNG

 

Then, use IF condition to wrap your measures, similar to:

Sum total =
IF (
    LASTNONBLANK ( Tb1[Slicer Items2], 1 ) = "Product",
    CALCULATE ( SUM ( Tb2[Values] ), ALLEXCEPT ( Tb2, Tb2[Product] ) ),
    CALCULATE ( SUM ( Tb2[Values] ), ALLEXCEPT ( Tb2, Tb2[Sub-Product] ) )
)

6.PNG7.PNG

 

That case, you have to add both two binning groups [Product] and [Sub-Products] into visual.

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

1 REPLY 1
v-yulgu-msft
Employee
Employee

Hi @bcreed2,

 

As it is not supported to dynamically change column fields displayed on table visual depend on slicer selection, there is no direct solution to achieve your requirement.

 

Here are two workarounds just for your reference which might not meet your requirement exactly.

 

Unpivot table first. Select both [Product] and [Sub-Product] fields then, click the "Unpivot columns" button.

1.PNG2.PNG

 

Then, drag [type] field into slicer and place the other two into table visual.

3.PNG4.PNG

 

In that case, table's structure is changed which might affect some mesaures calculation.

 

Alternatively, you can create an extra table which lists all available slicer selections like below.

5.PNG

 

Then, use IF condition to wrap your measures, similar to:

Sum total =
IF (
    LASTNONBLANK ( Tb1[Slicer Items2], 1 ) = "Product",
    CALCULATE ( SUM ( Tb2[Values] ), ALLEXCEPT ( Tb2, Tb2[Product] ) ),
    CALCULATE ( SUM ( Tb2[Values] ), ALLEXCEPT ( Tb2, Tb2[Sub-Product] ) )
)

6.PNG7.PNG

 

That case, you have to add both two binning groups [Product] and [Sub-Products] into visual.

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.