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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
AartiD
Helper I
Helper I

how to convert Measure into Slicer

I want to convert one measye "Sales Type Indicator " Into Slicer. and used below steps , but its not working. Note:- Monthly Avg. SKU No., Current Month Sales and Sales type Indicator all are measures.

Creating a Slicer from a Measure in Power BI

Power BI does not allow direct use of measures in slicers. However, you can simulate slicer behavior using a disconnected table. This document outlines the steps to create a slicer for the 'Sales Performance Category' measure using a disconnected table approach.

Step 1: Create a Disconnected Table for Slicer Options

Go to 'Modeling' > 'New Table' and enter the following DAX expression:

SalesPerformanceCategorySlicer =
DATATABLE(
    "Category", STRING,
    {
        {"Growth"},
        {"De-Growth"},
        {"Product Loss"},
        {"No Data"}
    }
)

Step 2: Create a Measure to Capture the Slicer Selection

Create a measure to capture the selected slicer value:

SelectedCategory = SELECTEDVALUE(SalesPerformanceCategorySlicer[Category])

Step 3: Define the Sales Performance Category Measure

Use the following DAX to define your measure:

Sales Performance Category =
VAR CurrentMonthSales = SUM('Table1'[Current Month Sales])
VAR AvgMonthlySales = AVERAGE('Table1'[Monthly Average SKU No.])
RETURN
    SWITCH(
        TRUE(),
        CurrentMonthSales > AvgMonthlySales, "Growth",
        CurrentMonthSales < AvgMonthlySales && CurrentMonthSales > 0, "De-Growth",
        CurrentMonthSales = 0, "Product Loss",
        "No Data"
    )

Step 4: Create a Filter Measure to Use in Visuals

Create a measure to filter visuals based on the slicer selection:

ShowData =
VAR Category = [Sales Performance Category]
VAR Selected = [SelectedCategory]
RETURN
    IF(Category = Selected || ISBLANK(Selected), 1, 0)

Step 5: Apply the Filter Measure to Your Visuals

  1. Add the 'SalesPerformanceCategorySlicer[Category]' field to a slicer.
    2. Add your visuals (e.g., tables, charts).
    3. Drag the 'ShowData' measure to the Filters pane of each visual.
    4. Set the filter to show only when 'ShowData = 1'.

AartiD_0-1753087925053.png

 

1 ACCEPTED SOLUTION
V-yubandi-msft
Community Support
Community Support

Hi @AartiD ,

Thank you for sharing your scenario. I have reproduced the requirement using sample data and can confirm that everything is functioning as expected

1. The  Sales Type Indicator  measure is categorizing the SKUs correctly.

2. The disconnected slicer is filtering the visuals based on the user's selection.

3. No calculated columns were required as everything is managed through DAX measures.

FYI:

Vyubandimsft_0-1753094601992.png

 

 

Vyubandimsft_1-1753094614714.png

 

I have attached a PBIX file with the complete setup for your reference. Please let me know if you would like a walkthrough or any further adjustments.

 

Best regards,
Yugandhar.

View solution in original post

3 REPLIES 3
V-yubandi-msft
Community Support
Community Support

Hi @AartiD ,

Thank you for sharing your scenario. I have reproduced the requirement using sample data and can confirm that everything is functioning as expected

1. The  Sales Type Indicator  measure is categorizing the SKUs correctly.

2. The disconnected slicer is filtering the visuals based on the user's selection.

3. No calculated columns were required as everything is managed through DAX measures.

FYI:

Vyubandimsft_0-1753094601992.png

 

 

Vyubandimsft_1-1753094614714.png

 

I have attached a PBIX file with the complete setup for your reference. Please let me know if you would like a walkthrough or any further adjustments.

 

Best regards,
Yugandhar.

Superb, this is perfect and working. thank you so much.

FBergamaschi
Solution Sage
Solution Sage

Please clarify what you mean when you say

 

I want to convert one measure "Sales Type Indicator " Into Slicer

 

Do you mean that you want to give options to the user to select an item from a slicer and show the corresponding measure into the graph?

 

If that is the case, please use Field Parameters, (create a new one from Modeling - Parameters, Fields - give it a name, include the measures you want the user to be able to select from the slicer, leave the "Addslicer to current page" flagged, go ahead with clickign "Create" and then include the colum name of the Fiels into the Values section of the graph)

 

FBergamaschi_1-1753089124252.png

 

 

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors