有条件地隐藏Matrix中的列

有条件地隐藏Matrix中的列

本文介绍了有条件地隐藏Matrix中的列-Powerbi桌面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人找到解决这个问题的好方法吗?

Has anyone found a cool solution for this problem?

我有一个如下表.

如果其中没有值,我想完全隐藏前列或后列.因此,在屏幕截图中,所需的结果是将隐藏10月和11月的前两个Post列,同时也隐藏1月的Pre列.

I want to completely hide the pre or post columns if there are no values in them. So in the screenshot the desired result would be that the first two Post columns, for Oct and Nov, would be hidden and the Pre column for Jan would also be hidden.

我读过有关使用视觉级滤镜的信息,但由于它是矩阵而不是单列,因此不起作用.

I read about using visual level filters but as it is a matrix and not a singular column this doesn't work.

金额值已在使用开关进行度量选择.

The amount value is already using a switch for measure selection.

以防您看不到图像.行是类别,列有日期,我有两种度量,一种称为前",另一种称为后".大多数情况下,如果pre满了,则post为空,反之亦然,除了1或2个月的重叠

In case you can't see the image. Rows are categories, columns has date and I have two measures one called pre and one called post. Most and the time if pre is full, post is empty vice versa except for 1 or 2 months overlap

推荐答案

虽然不好,但是我有解决方法.

It's not great but I have a workaround.

创建一个新的尺寸表 DimMeasure (没有关系):

Create a new dimension table DimMeasure (with no relationships):

Measure
--------
Pre
Post

编写一个基于新维度选择 [Pre] [Post] 的切换度量.

Write a switching measure that picks [Pre] or [Post] based on the new dimension.

PrePost = IF ( SELECTEDVALUE ( DimMeasure[Measure] ) = "Pre", [Pre], [Post] )

DimMeasure 添加到月份下方矩阵中的列中,并将 [PrePost] 添加到值中,而不是两个组成部分.

Add DimMeasure to you columns in the matrix below the month and [PrePost] to the values instead of the two component measures.

这篇关于有条件地隐藏Matrix中的列-Powerbi桌面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 22:09