I have some experience in SSRS, but new in Power BI.
Would you prompt me please the first step create a detailed report in Power BI.
Initial dataset:
Client Country Month
John USA jan
Ivan Russia feb
Albert England mar
... ... ...
Desirable result:
The matrix with aggregations on the top of the Page:
Clients jan feb mar
England 50 5 30
USA 75 7 15
Russia 25 5 15
By clicking on the numbers, I want to get filtered information about clients on the bottom of the Page (e.g. if we click on 50, we get 50 rows with clients from England in January):
Client Country Month
Mary England jan
Mick England jan
Albert England jan
... ... ...
This can be done by creating 2 linked objects in Power BI: the matrix and the table.
Matrix:
Rows = Country
Columns = Month
Values = Count of ClientS
Table:
Values = Country, Month, Clients
Related
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
I have two simple tables. I need to able to determine who is 'new' as of a particular date (say January) and then count only those attributes. There's a 1:M relationship on name. I basically need to answer the following questions with the below data:
What is the total number of FamilyMembers based on log-in for the month? (Done using custom measure)
Out of the total of #1 - how many have logged in for the first time?
Out of the total of #2 - how many were children? How many were adults?
Log In Table
ID
Name
Date
login1
Sam
Jan
login2
Sam
Jan
login3
Dave
Jan
login4
Dave
Jan
login5
Jack
Jan
login6
Sam
Jan
login7
James
Feb
login8
James
Feb
login9
James
Feb
login10
Sam
Feb
login11
Sam
Feb
login12
Steve
Feb
Contact Table
Name
FamilyMembers
Child
Adult
Sam
3
1
2
James
2
1
1
Dave
4
2
2
Jack
1
0
1
Steve
6
1
5
Using this data, filtered on February we would see Steve never signed in prior to that date, so that makes him 'new'. James is also new.
My closest attempt is the custom 'Count of New Individuals' Measure
VAR currentUsers = VALUES('Log-Ins'[Name])
VAR currentDate = MIN('Log-Ins'[Date])
VAR pastUsers = CALCULATETABLE(VALUES('Log-Ins'[Name]),
ALL('Log-Ins'[Date].[Month],'Log-Ins'[Date].[MonthNo],'Log-Ins'[Date].[Year])
, 'Log-Ins'[Date]<currentDate)
VAR newUsers = EXCEPT(currentUsers,pastUsers)
RETURN COUNTROWS(newUsers)
As you can see this gives me the count of new individuals but I want to count their attributes to say :: Out of the 11 total family members, 8 were new. Out of those 8, 6 were adults and 2 were children.
I may be getting lost in the translation, but I don't understand how exactly you want to display the information.
#ContactsWhoLoggedIN :=
CALCULATE(COUNTROWS(Contacts),FILTER(Contacts,CALCULATE(COUNTROWS(LogIN)>0)))
#NewCWhoLoggedIN :=
CALCULATE(COUNTROWS(Contacts),
FILTER(Contacts,
//LoggedIn in the Current Date Context
CALCULATE(COUNTROWS(LogIN))>0
&&
//Never LoogedIN before the Current Date Context
CALCULATE(COUNTROWS(LogIN),FILTER(ALL(Dates),Dates[Date]<MIN(Dates[Date])))=0
)
)
#CWhoLoggedBackIN := [#ContactsWhoLoggedIN]-[#NewCWhoLoggedIN]
#FM_NewCWLI :=
CALCULATE(SUM(Contacts[FamilyMembers]),
FILTER(Contacts,
//LoggedIn in the Current Date Context
CALCULATE(COUNTROWS(LogIN))>0
&&
//Never LoogedIN before the Current Date Context
CALCULATE(COUNTROWS(LogIN),FILTER(ALL(Dates),Dates[Date]<MIN(Dates[Date])))=0
)
)
I remember this pattern from "Microsoft Excel 2013: Building Data Models with PowerPivot"
I have a column in excel named Month which consists data like-
When you create a chart with E_no by month you will get something like this
This is what the column exactly means
(In Jan 765 people were hired
In jan-feb-Mar 2276 people were hired)
How the chart looks like
Jan. -----------765
Jan-feb-mar ---------------------- 2276
Sep-Oct. ---------- 10
Oct. -------- 2
(the dashes are basically the bars of a horizontal bar graph and Jan, jan-feb-Mar as my Y axis)
E no
Month
2038
feb-mar-jun
657
Sep-Oct
221
Jun
6507
Oct
876
Mar-Apr-May
17
Nov-Dec
615
Dec
Now what I want is to create buckets like June should fall under the category of feb-mar-jun , Dec should fall under the category of Nov-dec, Oct should fall under the category of sep-oct.
for eg -
From these
Jan. -----------765
Jan-feb-mar ---------------------- 2276
Sep-oct. ---------10
Oct ----2
My o/p should look like
Jan-feb-mar -------------------------------- 3041
Sep-Oct ------------- 12
I'm new to power bi so if anyone have any good method other than this what I have mention would really help me to to get rid of this.
Let me know if you have any doubt regarding my question
Thanks in advance
I have a number of transactions in my model:
Transaction Date Category Amount
1 Jan Sales $1000
2 Feb Expense $500
3 Jan Expense $500
4 Mar Interest $100
What is the most efficient way to generate report in the template? However would you structure your queryset to get the data by month for a given year (knowing some category will be null/empty) and pass the context information in view.py? I know this is an easy questions but I'm curious what is the most efficient way to implement this matrix reporting?
Category Jan Feb Mar
Sales $1000
Expenses $500 $500
Interest $100
Total $500 -$500 $100
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: