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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Use full history of query for visual

Hello everyone.

 

I have a large table with the rows being individual customer orders and the columns being the different features a customer can choose to configure his order:

 

Order NumberOrder DateTypeColor...
1012020SmallRed...
1022019LargeGreen...
1032020LargeRed...
...............

 

What I want to achieve is a table with a list of all features, the possible variants per feature and how often each variant was chosen:

 

FeatureVariants of featureCount
Order Date20202
 20191
TypeSmall1
 Large2
ColorGreen1
 Red2
.........

 

So far, I edited the initial table in the Power Query Editor using a Python script and achieved the desired table:

 

 

 

import pandas as pd 

intermediate_result = dataset.apply(lambda x: x.value_counts(dropna = False)).T.stack().sort_index() 
final_result = intermediate_result.reset_index() 
final_result.columns = ['Feature', 'Variants of feature', 'Count']

 

 

However, once I visualise the table using a matrix visual, the matrix visual cannot be filtered by clicking on other visuals that are based on the columns of the inital table. For example, I would like to see only the ordered features and variants for a certain Order Date.

 

I think the problem is that the matrix visual only considers the last step in the "Applied Steps" in the Power Query Editor and not the full history of the query.

 

Is there a way to solve this problem?

 

Tank you very much!

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Could you pls share your pbix file? Remember to remove confident data.

 

Best Regards

Lucien

Anonymous
Not applicable

Hi @v-luwang-msft,

 

I have trouble uploading the pbix file. It says that pbix is not supported 🤔

However, I try to explain my problem in more detail.

 

My initial table looks like this:

Starter_0-1621255150392.png

 

What I would like to achieve is a matrix visual containing a list of all features, the possible variants and the count for each variant. It is supposed to look like this:

Starter_4-1621255446863.png

 

Therefore, I transformed my initial data in the Power Query Editor using the code from above. Then the final table in the Power Query Editor looks like this. This final table is used as basis for the matrix visual.

Starter_5-1621255588553.png

 

Using the slicer filter I would now like to filter the matrix visual only for specific years. For example, I would only like to see which colour or sizes were ordered in 2020. I tried this by addind the column "Year" of the initial table in the slicer visual but this of course does not work. Is there a way to fix this? 

 

Thanks in advance!

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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