Power Bi Diff and Diff% - powerbi

my budget vs actual report diff and diff% value is not making sense here is how I calculated my values. I was given amount and amount + for both Budget and actual Need Help!

Related

Creating a measure for specific requirement in Power Bi

I am facing this below issue.
I need to calculate Budget variance % which is ((Actual Cost -Budget)/Budget)*100. So for that we need to sum the actual cost for a particular month say, January,2021 and have to subtract budget for that particular month(Jan) only, for each costcenter , and we have got only single budget for every month for each cost center whereas we have actual cost for each day in a month ,for each cost center ,which will be summed up. Actual cost and budget are coming from 2 diff tables say A & B respectively. Table A is having columns named Cost center,Date,ActualCost,OrderID. Table B consists of columns named, Cost center,Date,Budget. Date column is having diff set of dates in two diff tables A & B. So, when I am trying to do the required calculation, its throwing error . Can anyone please help me with the steps to follow to calculate this Budget variance?

Running Total Measure calculating incorrectly

I have a dataset containing costs by date incurred, cost type, and location. Cost type can be either Actual or Estimate and location is A, B, and C. I have a measure that calculates running total of Cost by Date Incurred. (Just for background, if the Date Incurred is in the future, the Cost type is entered as Estimate, but if the Date Incurred is in the past, the Cost Type is entered as Actual. It gets updated daily.) When I view my Cost Running Total measure, it calculates correctly. However, when I filter for Location, it resets the calculation when the Cost Type switches from Actual to Estimate.
This is the DAX I'm currently using:
Final Cost running total in Date Incurred =
CALCULATE(
SUM('data_tbl'[Final Cost]),
FILTER(
ALLSELECTED(data_tbl[Date Incurred]),
ISONORAFTER('data_tbl'[Date Incurred], MAX('data_tbl'[Date Incurred]), DESC)
)
)
And this is the expected vice actual results:
Note that when I remove the filter for Location A, Power BI calculates the numbers in Column E, but when I filter for Location A using a slicer, Power BI switches to calculating the numbers in column F. Is there any way to work around this so that Power BI won't add the Cost Type as a filter?
EDIT: There is a third cost type in the data set. I need to be able to filter out that cost type and display the Actual and Estimate costs, but I don't want the calculation to reset when the cost type switches between the two cost types that I have selected to view.

Power Bi Calculating number of days dynamically

I am using a slicer to determine a certain periode of time (e.g. 01.10.19 - 31.10.19) and now I want Power Bi to calculate how many days are included (in this case it would be: 31). Of course the calculation needs to be updated every time I use the slicer. Is there any possibility to do so? I have literally no idea...
Create a measure to calculate the difference between the max and min dates in your date table, which is filtered by this slicer. You can use DATEDIFF function for that. In this case the number of days will be calculated as:
Number of days = DATEDIFF(MIN('Calendar'[Date]); MAX('Calendar'[Date]); DAY) + 1

Wrong Total in Power BI

I am creating a measure, Measure = divide(sum(amount),count(task)), this is giving me incorrect total.
This is what I am getting in Power BI.
Now the result which is expected here is
Basically what I want is to get the total of the measure that I have created, Power BI is dividing the total sum with the total count.
The answer could be quite mundane.
Instead of the Measure = divide(sum(amount),count(task)) you may instead be wanting to use:
Measure = SUM(amount)
The divide(sum(amount),count(task)) measure is a longhanded way of calculating the mean (AVERAGE being the shorthand way). But what you seem to require is the SUM.

Count number of records totalling a given percentage of the overall total in Power BI

I'm relatively new to power bi so please bear with me!
I have a report which looks at information about individual stores of a given customer.
One of the requirements is to show the % that the top N stores constitute to the overall total, for example the top 1 store makes up 30% of overall sales, top 5 stores make up 65% of the overall total, etc. I can achieve this easily using the 'Top N' filter function.
The other requirement is to count the number of stores which total 80% of the overall total sales. For example, we have a total of 100 stores for a given account which generate a revenue of £10,000. The top 60 stores generate a revenue of £8,000, therefore 60 of the 100 stores make up 80% of the overall sales.
Hopefully that makes sense! Is this possible within power bi? If so could someone point me in the right direction?
Thanks in advance for your help.