Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi, can you help count the number of weeks in the selected month? Instead of using the hardcoded value '4', it should calculate the number of weeks in the selected month.
Measure:
Budget = 'Budget'[Budget $ SUM]/4
Thanks!
Solved! Go to Solution.
Thanks for the reply from@lbendlin ,please allow me to provide another insight:
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2.Create calculated column references:
weeknumber = WEEKNUM('Table'[Date])
3. Below are the measure I've created for your needs:
Budget =
VAR number1=DISTINCTCOUNT('Table'[weeknumber])
RETURN 'Table'[Budget $ SUM]/number1
4.Here's my final result, which I hope meets your requirements.
5.Here is the relevant documentation:
WEEKNUM function (DAX) - DAX | Microsoft Learn
Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply from@lbendlin ,please allow me to provide another insight:
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2.Create calculated column references:
weeknumber = WEEKNUM('Table'[Date])
3. Below are the measure I've created for your needs:
Budget =
VAR number1=DISTINCTCOUNT('Table'[weeknumber])
RETURN 'Table'[Budget $ SUM]/number1
4.Here's my final result, which I hope meets your requirements.
5.Here is the relevant documentation:
WEEKNUM function (DAX) - DAX | Microsoft Learn
Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
What is your definition of week? Do you want to see an integer number or a decimal number (4.428571428571 weeks, for example) ?
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
19 | |
14 | |
8 | |
7 |