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
rsbin
Super User
Super User

Slicer for Unpivoted Data

Good Morning,

I have a large table with about 50 columns. Each record is Daily data for 3 Facilities.

Am working with a Direct Query model in Visual Studio so unable to do anything in Power Query

4 columns are used to display a stacked column chart.  The chart is simply a sum of A, sum of B, sum of C, sum of D for each Day.

rsbin_0-1647009426563.png

The User has requested the ability to slice the visual by Category.

Looking for advice on how best to do this?  Do I need to Unpivot the table and create a Slicer using the new Category column or is there another way to do this?

Thanks and regards,

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

Hi @rsbin ,

As you mentioned in your previous post, the Direct Query connection mode has some limitations and does not support the unpivot feature. You can follow the steps below to implement your requirements:
1. Create a column dimension table using enter data as follows

yingyinr_0-1647331840909.png

2. Update the measures to calculate the summary values of columns A, B, C and D respectively as follows:

Your measure = 
IF (
    "A" IN ALLSELECTED ( 'Slicer Dimension'[Columns] ),
    SUM ( 'Table'[A] ),
    BLANK ()
)

yingyinr_2-1647332975558.png

Best Regards

Community Support Team _ Rena
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
v-yiruan-msft
Community Support
Community Support

Hi @rsbin ,

As you mentioned in your previous post, the Direct Query connection mode has some limitations and does not support the unpivot feature. You can follow the steps below to implement your requirements:
1. Create a column dimension table using enter data as follows

yingyinr_0-1647331840909.png

2. Update the measures to calculate the summary values of columns A, B, C and D respectively as follows:

Your measure = 
IF (
    "A" IN ALLSELECTED ( 'Slicer Dimension'[Columns] ),
    SUM ( 'Table'[A] ),
    BLANK ()
)

yingyinr_2-1647332975558.png

Best Regards

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

@v-yiruan-msft,

Thank you for your suggested solution.

I will keep this one handy for next time - or maybe replace my current solution with this one.

Thanks again and Kind Regards,

lbendlin
Super User
Super User

Can you please elaborate on this part "Am working with a Direct Query model in Visual Studio so unable to do anything in Power Query" - how are you doing that? Are you connecting to the XMLA endpoint?

 

 

Good Morning @lbendlin ,

Thanks for the reply, but I have gone ahead and created a Calculated Table with the Category I needed.  Was simpler than I thought it would be.

As for your question, no I am not doing anything with XMLA endpoints.  Perhaps I phrased that first sentence incorrectly.  I am simply working with a direct connection to Azure and using a tabular model in Visual Studio.  Hope this clarifies.

Thanks again for taking the time to reply!

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.

Top Solution Authors