I am new to Power BI.I have one year filter (Range filter) and one week number filter (Range filter). I want to calculate values such that when i select year 2021 to 2022 and week number 42 to 10 it will first show data for 42th weeks to 52th weeks for year 2021 and for 1st week to 10 th weeks for year 2022.
Related
Outlet ID
Outlet Name
Order Date
Product
Qty
Net Value
Mum_1
Prime Traders
12th Oct 2022
RoundBox
3
300
Mum_4
Avon Trading
13th Oct 2022
Slice 100
10
1000
I have date wise transaction data for past 20 months for retail outlets.
Any outlet that has been billed in the last 3 months can be classified as an 'Available Outlet'.
Eg: Available outlets for Sept 2022 are the ones that have been billed at least once across July, August & Sept 2022.
Similarly I need to have ,month wise availability count in a column chart. Can someone please guide as to how can I write a DAX query for the same ?
I have two tables in PowerBI, one modified date and one fact for customer scores. The relationship will be using the "Month Num" column. Score assessments take place every June, so I would like to be able to have the scores for 12 months (June 1 to June 30) averaged. Then I will just have a card comparing the Previous year score and Current year score. Is there a way to do this dynamically, so I do not have to change the year in the function every new year? I know using the AVERAGE function will be nested into the function somehow, but I am getting confused not using a calendar year and not seasoned enough to use Time Intelligence functions yet.
Customer Score Table
Month
Month Num
Year
Score
Customer #
June
6
2020
94.9
11111
July
7
2020
97
11111
months
continue
2020
100
June
6
2021
89
22222
July
7
2021
91
22222
months
continue
2021
100
June
6
2022
93
33333
July
7
2022
94
33333
Date Table
Month
Month Num
Month Initial
january
1
J
feb
2
F
march
3
M
other
months
continued
Sum a payweek that is always Wednesday through Tuesday each week where the payments are made multiple times throughout that week on any day in that week, i.e., payments might be Thursday, Saturday, and Sunday only. Next week might be Wednesday,Friday, and Tuesday. So the day of the week of payments vary as do the number of payments in that week (once, twice, three times, etc).
I need something like weeknum where the day the week the week starts can be chosen (Wednesday). Can add a helper column if needed.
4835259 Mon 3/21 CINCINNATI $8,000
5245716 Tue 3/22 HIGHLAND IL $2,500
5352002 Thu 3/24 LOUISVILLE $4,475
5352016 Fri 3/25 NASHVILLE $3,375
So in this example, I only want $4475 & $3375 summed. Most recent days of week Wednesday through Tuesday (Never including last Tuesday). As you can see, data is not necessarily entered for every day of the week. So just counting back seven days won't work. The most recent week to be totalled might have 4 or 5 entries to sum, or only 1 or 2. Sum each week Wednesday through Tuesday not including last Tuesday.
Below works, but w/o the fixed range. Or count Tuesday but only keep the most recent Tuesday to eliminate last Tuesday.
=SUMPRODUCT(F421:F423, (B421:B423="Wed"
)+(B421:B423="thu")+(B421:B423="fri")+(B421:B423="sat")+(B421:B423="sun")+(B421:B423="mon")+(B421:B423="tue"))
=SUMPRODUCT(--(WEEKNUM(C370:C423+0,13)=C426),F370:F423)
I have a table like this.
Company Amount Year
A 200 2016
B 300 2016
C 400 2016
A 500 2017
B 600 2017
C 700 2017
A 100 2016
B 400 2016
C 100 2016
A 600 2017
B 133 2017
C 50 2017
I am looking for a measure calculate the Percentage of amount that top 2 companies(based on amount) contributes to that particular year's total amount. This needs to be dynamic based on the values of Year slicer. (For Example if 2 years are selected, then the top 2 companies needs to be based on the total amount that the company has spent on those 2 years).
How about this as a measure?
PercentTop2 =
DIVIDE(
SUMX(
TOPN(2,
SUMMARIZECOLUMNS(Companies[Company],
"Amount", SUM(Companies[Amount])),
[Amount]),
[Amount]),
SUMX(ALLSELECTED(Companies), Companies[Amount]))
The TOPN(2,[...]) finds the top 2 rows of the summarized table. Then you divide the sum of those two rows by the sum of all the selected rows.
I am trying to create a variance measure in PowerBI.
This is the data that I have,
Month Year MonthNo Value
Jan 2016 1 700
Feb 2016 2 800
March 2016 3 900
April 2016 4 750
.
.
Jan 2017 13 690
Feb 2017 14 730
And My variance for the Month Number 7 should be like,
`{Avg(values(4,5,6) - Value(7)} / Value(7)`
i.e (Average of last 3 months value - current month value) / Current month value
How to do this in Power BI? Thanks.
If it is okay for you to use a column, I believe you could add one with this code to get what you want:
Variance = (CALCULATE(AVERAGEX(Sheet1,Sheet1[Value]),FILTER(FILTER(Sheet1,Sheet1[MonthNo]<=EARLIER(Sheet1[MonthNo])-1),Sheet1[MonthNo]>=EARLIER(Sheet1[MonthNo])-3))-Sheet1[Value])/Sheet1[Value]
You'll need to replace all instances of Sheet1 with the name of your table.
It'll give you something like this: