Power BI Show only MTD - powerbi

I have a problem with the MTD column. I want this column to show only April '22 sales and not the previous months. For example, the sales for April '22 is 7379,42 so I want this number only to be shown on the MTD column, of course, I want the same for the other product types. Thank you.enter image description here

Related

POWER BI adding a new column to existing calculated table based on relation

I would like to ask for your help with solving following problem:
I have a table called IncomeTable with three columns: Team, Income (Value), Date (month + year)
Team Income Date
Sales 5000$ january 2020
Marke 2000$ march 2021
I have another table CostsTable with very similar structure:
Team Costs Date
Sales 3000$ january 2020
Marke 1000$ march 2021
What I would like to do is to create a new calculated table that looks like that:
Team Income Costs Date
Sales 5000$ 3000$ january 2020
Marke 2000$ 1000$ march 2021
There is relation between those two tables on Date column. I tried many different formulas with Summarize, SummarizeColumns but nothing seems to solve my problem.
Could you please give me a tip how to calculate that?
Many thanks in advance.
I presume your relationship should be based on Team and Date. If this is this case, the following should work.
NewTable = ADDCOLUMNS( IncomeTable,
"Costs", CALCULATE(MIN(CostsTable[Costs]), TREATAS( SUMMARIZE(CostsTable, CostsTable[Date], CostsTable[Team]), IncomeTable[Date], CostsTable[Team] ) ))

DAX functions not resulting accurate for Datemaster table

I have a Sales table in my model which contains Date column along with other columns, However I have created a separate Datemaster table to work with dates which contains year, month, quarter, date, weekday etc columns.
I have connected both using Date column.
When I use Datemaster for DAX like the one below -:
ENDOFMONTH = CALCULATE(SUM(Sales[Total Revenue]), ENDOFMONTH(Datemaster[Date]))
The results are inaccurate whereas when I replace Datemaster with Sales -:
ENDOFMONTH = CALCULATE(SUM(Sales[Total Revenue]), ENDOFMONTH(Sales[Date]))
The results are accurate.
Why is it so?
Detail : When using Datemaster, the DAX gives me revenue only for 12th month of 2017 whereas using Sales in DAX gives me month wise revenue for all months for 2014, 2015, 2016 and 2017.

Power BI - Selecting and Filtering Columns based on Slicer Selection

Hello Stack Overflow Community,
In the attached excel sheet image, there are 5 columns (cols B to F) that have arbitrary sales numbers for years 2016-2020. In the report there will be a year slicer of each of these years. I want to calculate the total sales depending on the selection in the year slicer. However, there are 15 columns towards the end which dictate whether a particular company should be included in the total sales calculation. Only if the column corresponding to the selection by the user is N, the value should be included in the total sales calculation.
Example: If the user selects 2016,2017 and 2018 in the year slicer, Power BI should look into the column Excluded 2016-2017-2018 and include/ exclude the sales numbers of the respective years and finally return a table as below
Year Sales (Total)
2016 393
2017 561
2018 580
There is two problem in your case : the first is to be able to calcule with the filter and I think it will be easier if you do this in Excel and the second problem is to use a filter on a combinaison of imput to select only one value.
For the fist problem you could probably do something like that :
=IF(H2="Y";F2;0) / =IF(I2="Y";G2;0) / =IF(J2="Y";G2+F2;0)
and use the power of excel to slide the formula to the bottom of your table
And the next step is to sum the entire column and pivot the table :
But for the selection of the right row with your slicer on date i can't find a solution maybe you need to build a slider for all combinaison : 2016 / 2017 and 2016-2017,...

Power BI, I need to calculate sold product between two date

i'm new in power bi and i need some help.
i need to calculate total sold product between two dates, e.g. from 5 Feb 2021 to 5 apr 2021, i cant find any solution.
Assume you have sales table with two column Date and Amount. Now you can create your measure as below-
total_sold =
CALCULATE(
SUM(sales[amount]),
DATESBETWEEN(
sales[date],
start_date,
end_date
)
)
Create a card or table and drag your no. of products sold column to the card, and use the filter on the date column to get the total no. of products sold in the time period.
Note:- Please be a little more specific and descriptive the next time.

Calculate revenue by week - sunday to saturday (last year) on tabular cube/Power BI

I have a report on Power BI where data comes from a tabular cube. The DAX expressions are made in the cube. When drilling down in Power BI and comparing results to the original numbers there is a slight difference. Power BI calculates the week figures as monday - sunday, but I want it to show from sunday - saturday
Initial code:
IF(ISBLANK([Revenue]), BLANK(), CALCULATE([Revenue],SAMEPERIODLASTYEAR('Date'[Date]),ALL('Date'[Date])))
The date table in cube contains columns [SortFiscalWeek], [SortFiscalMonth], [SortFiscalYear], [Week Commencing],Fiscal Week Number.
Week Commencing is in accordance to Sunday (being the week commence date) - Saturday.
The sort fiscal columns start as 1 from years ago and end to whichever number it is today based on today's date.
I added Fiscal Week Number as I thought it might be helpful and tried using it as Test New Users LY = IF(ISBLANK([New Users]),BLANK(),CALCULATE([New Users],SAMEPERIODLASTYEAR('Date'[Date]),FILTER(ALL('date'),'Date'[Fiscal Week Number]='Date'[Fiscal Week Number]&&'Date'[YearInt] = 'Date'[YearInt]-1)))
EDIT
In Power BI I am using a Clustered Column Chart with Date Hierarchy in the Axis and Revenue in the Value. On week level it sums the Revenue as Monday-Sunday and not Sunday-Saturday. Hope this clears up some doubt as to how i am using the data in Power BI
Can anyone help?
If I understood well, I had the same problem, I created a calculated column giving me the name of the month, like this:
MonthName = SWITCH(DimDate[Month], 1,"gennaio",2,"febbraio",3,"marzo",4,"aprile",5,"maggio",6,"giugno",7,"luglio",8,"agosto",9,"settembre",10,"ottobre",11,"novembre",12,"dicembre","altro")
then I needed to order the month by month number, so to do this you need to select your calculated column, and then go to the tab Modelling>Sort by column, in this menu you can choose on which field of the table you order the selected field.
Hope that helps.