Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi, I have a measure [A] where it gives total monthly value. Additionally, I have a measure [B] that calculates the daily value by dividing [A] by the total number of days in the month. However, regardless of the month selected, [B] always returns the value for the last month.
What I want is a new measure that provides the sum of [B] for the selected date range.
Here are the different measures.
For example, if I select the date range from February 1, 2024, to April 5, 2024, I expect the result to be:
If the daily value of feb is 5, march is 6 and apr is 7, the result would be 5*days in February(29)+6*days in March(31)+7*days in April(5 in that case). The result is 145+186+35=366
Any assistance would be greatly appreciated. Thank you!
Solved! Go to Solution.
Hi, here is my solution, but It causes anther question:
My count selected days measure:
Add a proper Calendar table to your data model and use a row count over that instead - much simpler.
I'm unsure about what you are referring to.
Here's what I currently have done:
I created a column in calendar and in myTable with mm-yyyy dates. And related both.
Then I created another column in myTable, it calculates daily price by month,
Date | MM-YYYY | country | shop | sector | category | employee | totalMonthPrice | dailyPrice |
01-01-2024 | 01-2024 | A | 1 | R | 33 | A | 310 | 10 |
01-01-2024 | 01-2024 | A | 2 | T | 44 | B | 290 | 29 |
01-02-2024 | 02-2024 | A | 3 | T | 33 | C | 290 | 29 |
01-02-2024 | 02-2024 | B | 1 | R | 44 | D | 290 | 29 |
01-03-2024 | 03-2024 | C | 2 | T | 33 | E | 310 | 31 |
01-03-2024 | 03-2024 | A | 3 | R | 44 | F | 310 | 31 |
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
Hi, It was a table, here I attached a .xlsx with some data.
It is the result of multiplying 'SaleDaily' by 'DaysSelected'
The column SalesAcc is what I expect. When visualizing the data in a chart grouped by a certain key, 'SalesAcc' equals the sum of those values. Is the result of multiplying SaleDaily with DaysSelected. Take care, If i group by Key1, what I expect with SalesAcc is sum each value of different month and days month.
SaleDaily equals to TotalMonthSale Divided with number of days of its corresponding month, in that case January or February.
DaysSelected is a measure that calculates the number of selected days for each month. I'm filtering from 02/01/2023 to 08/02/2023.
I hope this information is suficient for your undersanding. Link To Data
Hi, here is my solution, but It causes anther question:
My count selected days measure:
Solved!
Daily Budget = SUMX(VALUES(Dim_Calendar[Date]), (CALCULATE([Budget], STARTOFMONTH(Dim_Calendar[Date]))) / DAY(EOMONTH(MIN(Dim_Calendar[Date]), 0))) * [SelectedDays]
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |