在图表中覆盖切片器筛选器上下文(以显示完整的X轴)

编程入门 行业动态 更新时间:2024-10-23 04:33:52
本文介绍了在图表中覆盖切片器筛选器上下文(以显示完整的X轴)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

想象一下,我有一个事实表,其销售额跨度为3年(2016-2018年)。我有一个图表,按月显示销售额(X轴上为36点)。我有一个选择器来选择Year = 2018,Month = June。

Imagine I have a fact table with sales spanning 3 years (2016-2018). I have a chart showing sales by month (36 points on the X-Axis). I have a slicer selection to Year = 2018, and Month = June.

是否有可能在一定程度上显示从图表开始的6个月切片器选择?换句话说,在切片器仍设置为Year = 2018和Month = January的情况下,图表能否显示6点(过去6个月)?

Is it possible, with a measure, to show on a chart, the trailing 6 months from the slicer selection? In other words, with the slicer still set to Year = 2018 and Month = January, can the chart display 6 points (the trailing 6 months)?

推荐答案

在这种情况下,我将使用的方法是为没有日期的日期创建参数表与我其他表的关系,并使用该日期作为切片器。然后,您将在图表上使用的销售指标写出来,以读取所选日期,并为不在所需范围内的任何日期返回空白。

The approach I would use in this case would be to create a parameter table for the date which doesn't have a relationship with my other tables and use that date for the slicer. Then you'd write the sales measure you use on the chart to read the selected date and return blanks for any dates not within the range you want.

大致如下:

NewSalesMeasure = VAR SelectedDate = SELECTEDVALUE(Slicer[Date]) VAR CurrentDate = SELECTEDVALUE(Sales[Date]) RETURN IF(CurrentDate <= SelectedDate && CurrentDate > DATEADD(SelectedDate, -6, MONTH) SUM(Sales[Amount]), BLANK() )

更多推荐

在图表中覆盖切片器筛选器上下文(以显示完整的X轴)

本文发布于:2023-10-30 19:24:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1543772.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:切片   下文   图表   器上   完整

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!