英文:
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:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论