如何测量当前月份每周的任何值的总和,进行筛选。

huangapple go评论63阅读模式
英文:

How to measure a SUM of any value for each week for the current month filtered

问题

我需要计算销售总量的可视化图表,我已经将销售量的表格与包含月份和周数的另一个表格链接起来。

我在编写一个度量标准时遇到了问题,该度量标准用于计算月份的第一周、第二周、第三周等销售量。

我想要筛选参考月份,并显示相应第一周、第二周、第三周等的销售总量。

我尝试使用度量标准 weeknumber = MIN()、weeknumber = MIN()+1、weeknumber= MIN()+2,但似乎度量标准不允许我在MIN公式中添加数字。

有人有办法解决这个问题吗?

谢谢!

英文:

I have a visual that I need to calculate the total volumes of sales, I have linked this table of volumes with another table that contains month and week numbers.

I'm having trouble writing a measure that calculates the volume of sales in the first week of the month, then another measure for the second week, the third, and onwards.

I want to filter the month of reference, and show me the total of sales for the respective first week, second week, third, etc...

I tried to use the measure weeknumber = MIN(), weeknumber = MIN()+1, weeknumber= MIN()+2 ,but it seems the measure don't accept for me to add number with the MIN formula,

Anyone has an idea of how can I solve this?

Thanks!

如何测量当前月份每周的任何值的总和,进行筛选。

答案1

得分: 0

Step1. 在销售表格中添加[月份]和[周]列,计算[销售量]指标以供下一步使用:

> 我已将此销售量表格与另一个包含月份和周数的表格关联起来

根据您的描述,我认为可以使用RELATED函数,但请确保您已在两个表格之间创建了一对多的关系,并且方向应该是从另一个表格到销售表格:

列:

月份=related('另一个表格',[月份])
周=related('另一个表格',[周])

指标:

销售量 = sum('表格'[销售])

Step2. 创建一个新表格以总结每周的销售量:

新表格 = 
summarize('表格','表格'[月份],'表格'[周],
"销售量",[销售量])

Step3. 通过添加新列[每月周数]计算每月的周数,加入到新表格中:

每月周数 = 
rankx(filter('新表格',[月份]=earlier('新表格'[月份])),
[周],[周],asc)

Step4. 创建任何您想要的可视化图表。

英文:

Step1. add [Month] [Week] column into sales table, calculate [sales volume] measure for next step:

> I have linked this table of volumes with another table that contains
> month and week numbers

based on your description, i think can use RELATED formula but should make sure you have created one-multiple relationship between two tables and the direction should be from another table to sales table:

columns:

Month=related('another table',[Month])
Week=related('another table',[Week])

measure:

Sales volume = sum('Table'[Sales])

Step2. create a new table to summarize sales volume of each week:

New table = 
summarize('Table','Table'[Month],'Table'[Week],
"sales volume",[Sales volume])

Step3. calculate week numbers per month with add new column [week no. per month] into New table:

Week NO. per Month = 
rankx(filter('New table',[Month]=earlier('New table'[Month])),
[Week],[Week],asc)

如何测量当前月份每周的任何值的总和,进行筛选。

Step4. create any visuals you want:

如何测量当前月份每周的任何值的总和,进行筛选。

huangapple
  • 本文由 发表于 2023年4月20日 03:04:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/76058025.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定