Apply vlookup in previous month data on some columns - ruby-on-rails-4

in 1 sheet i have data month wise with 5 columns.
I need to find vlookup for few columns in current month with previous month and look their value...in the same sheet

Related

DAX to calculate no of days between 2 dynamic dates

I have 2 date column in my table ie entrydate and exitdate and also containerno column and 1 seperate date table in power bi.
Now the case is -
I have 1 date slicer in report.
Need to count no of days in monthly basis.
Eg if my container enter in 20-nov-2020 and exitdate is 5-Dec-2020
So when we select 26-nov-2020 in my date slicer then
Required output is 6 days.
Means then my selected date will become my exitdate.
And when we select 1-dec-2020 to 10-dec-2020 then
Output is 5 days
So my entry and exit date can be dynamic based on selected date by comparing with entrydate and exitdate

How to extract Month and Year from column in PowerBI powerquery

I have a column (monthyear) in the image below. I want to extract the Month and year from the column to put it in the new column. Note: In my dataset this information goes for every day of the year
So the new column would look like:
01/2020
01/2020
01/2020
etc.
In Power Query, use some of the date functions.
To get the year it will be
Date.Year([monthyear])
For the month, it will depend on how you want to format it. Using the month of June as an example:
To get 'Jun'
Date.ToText([monthyear],"MMM")
To get the month number in the format 06
Number.ToText(Date.Month([monthyear]), "00")
Just to get the number 6 it will be:
Date.Month([monthyear])
In DAX use the date functions
For year the calculated column will be:
YEAR([monthyear])
For the month:
MONTH([monthyear])
I would always do a much data transformation in Power Query when you can before it gets to the data model.

How to do countifs in powerbi

I want to do countif in PowerBI (Example: count of total item with condition #1: having transaction of 2 or more, condition #2: year)
I have sample data comprised of PO (transaction) #, item #, date (year), item description, ship to location.
I can achieve the result through Excel - Pivot a matrix table of rows of items, columns of year and the value is count of PO/transactions. A separate table on the side is utilized to count the total item within Column (Years) that has transaction count > 2.
I can't figure out what DAX to use in PowerBI to achieve the same thing as I could with Excel:
Sample of transaction counts:
Usually COUNTIFS in Excel are implemented by use of CALCULATE(<expression>,<filter1>,<filter2>…) in Power BI, for example:
CALCULATE(SUM(Table1[Column1]), FILTER(Table1, Table1[Column1] < Table1[Column2]))
Read more details here.

How to show last six months data(one row for each month) in MDX query based on selected month filter in Power BI report?

I have created a cube with one fact table and 5 dimension which includes one Date dimension. Hierarchy of date dimension is Year -> Quater -> Month. Here I want to select the last six months data from selected month using mdx query. The output should be Month (Row Level) and Measures on Column level.
Thought of creating a dynamic named set but power BI doesn't consume named sets.
Can anyone please suggest a way to do it in MDX either using a disconnected date dimension or any idea in Power BI?
Take a look at the sample below
select
[Measures].[Internet Sales Amount]
on 0
,
[Date].[Calendar].[Month].&[2012]&[4].lag(6):
[Date].[Calendar].[Month].&[2012]&[4]
on 1
from
[Adventure Works]
Result

Show last 12 months of data on a bar chart according to the slicer choice

my issue is as below:
I hava a Calendar table with dates and Orders Table related to the Calendar table by DateID. I have slicer that allows user to choose month and year from a Calendar table so that the data will be shown only for the choosen month but on one bar chart i would like to show sum of orders by month (so month will be on X-axis) from Orders table not for one month but for the last 12 months where the last month is the one from the slicer. E.g. if user chooses 06-2107 from slicer then the bar chart should show orders data from 07-2016 till 06-2017. Obviously when the slicer and bar chart interact with each other i can see only one month.
I've tried to create a measure in DAX but I failed and the results are not what i expect. If the description is to messy i can provide the pbix file as an example