不同数据集/列的切片器过滤问题
创始人
2025-01-09 17:09:22
0

这个问题的解决方法可以采用 Power Query 实现数据合并来解决。 例如,你有两张表格:一张是销售表格,一张是产品表格,有一个共同的字段是 “产品 ID”。 首先,你需要将这两个表格合并起来,如下所示:

let Source1 = Excel.Workbook(File.Contents("C:\Desktop\Sales.xlsx"), null, true), Sales_Table = Source1{[Item="Sales",Kind="Table"]}[Data],

Source2 = Excel.Workbook(File.Contents("C:\Desktop\Products.xlsx"), null, true),
Products_Table = Source2{[Item="Products",Kind="Table"]}[Data],

Merge_Tables = Table.NestedJoin(Sales_Table,{"ProductID"},Products_Table,{"ProductID"},"Products",JoinKind.LeftOuter),
Expanded_Products = Table.ExpandTableColumn(Merge_Tables, "Products", {"ProductName"}, {"ProductName"}),
Sorted_Table = Table.Sort(Expanded_Products,{{"OrderDate", Order.Ascending}})

in Sorted_Table

然后,你可以将合并后的表格与切片器连接起来,将 “产品名称” 作为切片器的一个选项,如下所示:

let Source1 = Excel.Workbook(File.Contents("C:\Desktop\Sales.xlsx"), null, true), Sales_Table = Source1{[Item="Sales",Kind="Table"]}[Data],

Source2 = Excel.Workbook(File.Contents("C:\Desktop\Products.xlsx"), null, true),
Products_Table = Source2{[Item="Products",Kind="Table"]}[Data],

Merge_Tables = Table.NestedJoin(Sales_Table,{"ProductID"},Products_Table,{"ProductID"},"Products",JoinKind.LeftOuter),
Expanded_Products = Table.ExpandTableColumn(Merge_Tables, "Products", {"ProductName"}, {"ProductName"}),
Sorted_Table = Table.Sort(Expanded_Products,{{"OrderDate", Order.Ascending}}),

// Connect to the Slicer

Product_Slicer = Excel.CurrentWorkbook(){[Name="Product_Slicer"]}[Content

相关内容

热门资讯

透视大纲!wepoker究竟有... 透视大纲!wepoker究竟有没有透视(WePoKer正版)果然存在有辅助教程(哔哩哔哩)一、wep...
透视模块!聚星ai辅助工具激活... 透视模块!聚星ai辅助工具激活码(透视)pokemmo辅助脚本(辅助)果然一直都是有脚本(哔哩哔哩)...
透视方式!wepoker游戏安... 透视方式!wepoker游戏安装教程(WePoKer分析器)总是真的有辅助技巧(哔哩哔哩);1、下载...
透视资料!菠萝辅助器免费版的功... 透视资料!菠萝辅助器免费版的功能介绍(透视)福建大菠萝万能辅助器(辅助)一贯是真的有脚本(哔哩哔哩)...
透视窍要!哈糖大菠萝可以开挂吗... 透视窍要!哈糖大菠萝可以开挂吗(WPK控制牌)都是真的有辅助工具(哔哩哔哩)1、该软件可以轻松地帮助...
透视模块!hhpoker是真的... 透视模块!hhpoker是真的吗(HHpoker机器人)本来是真的有辅助技巧(哔哩哔哩)在进入hhp...
透视诀窍!epoker有透视吗... 透视诀窍!epoker有透视吗(透视)pokemmo修改器手机版(辅助)真是真的是有教程(哔哩哔哩)...
透视学习!wepokerplu... 透视学习!wepokerplus到底是挂了吗(WePoKer价格)好像是真的有辅助脚本(哔哩哔哩)1...
透视教程书!德州透视竞技联盟(... 透视教程书!德州透视竞技联盟(透视)pokerworld软件(辅助)真是一直总是有app(哔哩哔哩)...
透视模板!wepoker有脚本... 透视模板!wepoker有脚本吗(WePoKer私人局)真是存在有辅助攻略(哔哩哔哩)一、wepok...