how to get monthly and yearly totals using dax - powerbi

I'm kind of new to the power bi. I want to calculate the monthly yearly totals from the column Amount and TRD_date column. Please see the below data

The solution does not require DAX. You can do this easily in Power Bi Report Desktop. Just follow these steps:
Step 1- create a new Report and on a blank report, click the Table visual (show highlighted in yellow below)
Step 2- Bring in your datasource and drag over to the Values area of the visual, the Date column first, then the Amount column second. Your values will look like:
Step 3- Remove (click the X) for the Date-> Quarter Value and Date-> Day value. This will total the amounts for you by Month and Year.
Your table will be a shown below:
My data is shown here for reference:

Related

Create measure for % of Sales in Power bi

I am trying to create a % of sales measure in power bi. I currently have a visual that is filtered on sales for select items by day and another visual that just has the total sales by day and then I export and do the math in excel. I know there is a way to have just one visual give me the % of sales for the items I have selected, but can't figure out the DAX formula. I am looking for the formula that will take sales for item 1 on Monday of $3,461 and divide by total sales for Monday of $163,534 to get a 2.1% of sales (for all items). Thanks
Power Bi Visuals
I tried a couple formulas but was unsuccessful..
The December release of PBI has been pushed out to all users, and it comes with a brand-new WINDOW function. This allows you to create calculations that would be relative to data being displayed in the visualization rather than applying across an entire table.
Some things you can do with this type of DAX calculation:
Moving averages
Can also combine with parameters for additional functionality!
Dynamic reference lines
Cross row calculations
Finding best and worst performers (with ABS references)
Calculate contributions to the whole
Relevant links:
https://www.youtube.com/watch?v=eib5X5xRlz8
Introducing DAX Window Functions (Part 1) – pbidax (wordpress.com)
WINDOW – DAX Guide

How to change aggregation on Power BI

I'm trying to find the option to report sum of sales by month and country in data in Power BI.
At the moment the package defaults to count of sales and it reports like this:
I want change it so the chart reports and splits out the country.
On the Visualizations pane select the dropdown arrow on the Sales parameter and then switch from Count to Sum:

Power BI: How to Create a Matrix with Row Headers = Data label, Column Headers = Measures

I have a dataset consist of two time series: e.g. Historical stock prices for Apple and Microsoft. And I have a few different power BI measures created for each of these two stocks (e.g. Weekly Return, Monthly Return).
I want to create a "Matrix"-like visual, to show:
stock names as the row headers
measures as the column headers
values being the corresponding measure value for the given date selected on a date slicer
To illustrate what I want to do, please see the picture from Excel as an example. Is there a convenient way to do this in Power BI?
Thank you very much for your help!
Excel illustration on what the visual should look like in Power BI

Summation of rows based on Dropdown selection in Power BI

I have a dropdown in Power BI that contains different project name such as Project One, Two, Three. I have included one formula to bring forecast value which is:
Forecast = Chase * Target%
I have created one measure that calculates forecast. The dataset contains weekly based data for Chase and Target %. For example week 1 (Jan 01-Jan 08) Chase will be 30 and target % as 10 hence the forecast for Week 1 is 3 (30*10%)
When I select one project from dropdown list e.g. "Project One" I see the forecast value populating correctly. Same goes if I select only one project from dropdown list .
The issue arises when I select multiple projects and then the forecast value brings the maximum value instead of bringing summation to the values of all weeks of all projects.
Question: What exactly is causing the issue?
Now I understand your requirement from your comments. You can achieve this through 2 step as explained below-
Step-1: Create a custom column in your data source as below-
row_level_forecast = finetarget[chase]/100.00 * finetarget[target]
Step-2: Create the final Measure as below-
forecast = sum(finetarget[row_level_forecast])
Now, use measure "forecast" in the report. This should give you the desired output.
ISSUE-2: From your comments
If I understand correct, you are talking about a case where you are concern about values in columns I marked red in the below picture-
If I am correct with my understanding, you wants to fill week-3 values for Project-1 with 80/70 and for Project-2 100/90. If this is ok, just follow these following steps.
Step-1: Go to EDIT mode clicking "Transform Data" option and select the table you wants to adjust data.
Step-2: Sort your data first for project_name (ascending) then week (ascending). The output will be also as shown in the above image.
Step-3: Select column "chase" in the table and click Fill>>Down option.
Step-4: Repeat step 3 for column"target" as well.
The final output should be as below. Just move back to main report by clicking "Close and Apply". Data should be now as expected in your report.
When you display the forecast, put it in a grid and add the project column, the week column (e.g. Week 1) and the forecast measure. When you select your multiple projects the grid will show each of those along with the calculated measure. If this does not work, there is something wrong with your measure and you should add your measure calculation script to your question.
The measure should be simple, something like:
Forecast = SUM(YourTable[Chase]) * AVERAGE(YourTable[Target%])

Change Slicer Value in dropdown monthly to quarterly in power BI

I have a Power BI report in which i want users to select "Period Type" in drop down. and when they chose values like Monthly or quarterly it should dynamically change the slicer values to monthly or quarterly.
example is given below.
When Period Type Is Selected To Montlhy
https://pasteboard.co/IYuYSO2.png
When Period Type Is Selected To Quarterly
https://pasteboard.co/IYuYcVw.png
And i have data set with DimDate Table and FactSales Table. Both are joined Table with One to Many relationship.
Your question looks tailor made for a visual from the marketplace. Check the following link out:
https://appsource.microsoft.com/en-us/product/power-bi-visuals/WA104380786?tab=Overview
This slicer will let you choose the frequency and then your slicer will change to reflect that. You can download this from the marketplace. If you have not done this before, you can do this by selecting "Import from marketplace" option after clicking on the 3 dots at the end of the Visualization tab. Hope this helps.