Power consumption in houses by date - powerbi

I'm starting with Power Bi and I need some help to create the data model for this practice case.
I receive the data in a table that has the power consumption of different houses by hour. In the first column it has the date and hour and the rest of columns has the power consumption of each house (one column for each house).
My idea is to create a dashboard with a map as a filter to select the house and a date slicer to filter a period of time.
I dont know exactly what is the better way to face that, if create a subtable for each house or what.
I know that I also have to create another table with the information of each house with coordinates and relate it to the information table, but this information table has the name of the houses in the header of each column and the name is followed by the text "Power Cosumption".
I would appreciate your help, I think that this is not a complicate problem and you can give me some clues or examples to face it.
Thanks!
Regards

Related

Best way to organize data from multiple companies in Power BI

Basically I have a big Excel dataset about 500x500 with economic information from various companies.
Each row is representing a different company and in columns we have the information. A little bit of it is qualitative like ZIP code, type, etc. But most of it is quantitative. For each of the quantitative info, we have info for 5 years, so we have one column for each year and for each information i.e. Debt 2019, Debt 2020, etc.
So my question is which is the best way to preprocess this data to work with it and how should it be done. Either doing the preprocessing with Excel, running a Script on PowerBI, using Query, SQL, ...
The objective is to have a report which will be accessible online and the user will type the name of the company and it will show them the dashboard with the information of that company (only that one), so they can navigate through it.
The structure and which information is shown is the same for each company, the only thing that changes is the "numbers" that each company has. So it has to be possible to change which data is showing (to use the one from the company they want).
It also needs to be able to show comparative data to other groups of companies or to the total.
I want to have it right from the start, because then changes get complicated.
I thought about doing sort of a "relational model" with one "table" for each company with the quantitative data (with one row for each year and each column one info point) and then a general table with the qualitative data (with rows being each company and the columns the info). But I am not really sure.
I know how to use Power BI but I have never used it for something this big. I would like to know which way to organize this data is better and some info on how to do it.
Many thanks to everyone.
I thought about doing sort of a "relational model" with one "table" for each company with the quantitative data (with one row for each year and each column one info point) and then a general table with the qualitative data (with rows being each company and the columns the info).
Yes, do that.
General guidance is to use Power Query in PowerBI to transform the data into a star schema model. See Understand star schema and the importance for Power BI
So that would typically result in one table that has the "dimension" data for each company, a date table, and a "fact" table at the grain of (CompanyId,Date) with the quantitative data.

How do I create banded ranks?

I'm very new to Power BI and have a couple questions that will probably be easy to all of you.
I have a table where each row is an attendance and will have a user id, so multiple rows will have the same user id for a returning user (Table example). I have then created another table from that which gives the number of attendances per user (duplicating the table and then grouping it)
I would now like to categorise those users by top 10% of attenders, 10-20% of attenders such that I can create a graph like the one below (with the y axis being number of total attendances). Any help in how to do this would be greatly appreciated.
Image of ideal graph
The original table of each attendance will also have arrival date and departure date (along with the user id). I would like to find the next instant a user attended and if that arrival date is less than 7 days after the previous departure date, flag it (mark as Y). Once again, I do not know how to do this is power bi/query.
I've spent a large portion of the day trying to figure this out and going at it from a power bi and power query approach and being confused on both. Happy to provide anymore clarifying information anyone would need :)

Power BI DAX - Measure to change name of row value

I need some help creating a measure to change the name of "FROM_USER" in the slicer here.
I think I need to use the function SELECTEDVALUE, but I have not managed to get it working.
So, the column has only two values, CRAWLER and FROM_USER.
Any suggestions would be helpful!
See picture
Measures can't be used as slicer values. If you want the column values to be changed and yet to be used in a slicer, you need to create a calculate column to change that.
Column = IF('Table'[Column1]="FROM_USER","desiredValue","CRAWLER")
If you are really keen on using a measure to slice, you need to build a disconnected table and follow the method described here. But the performance will take a hit depending on how complex your data model and calculations are.

Change X axis date range start point depending on user selection

So for the purposes of this quandry, I have two tables in Power BI desktop. A 'Finance' and a 'Calendar' table.
The Calendar table has a filter (towards) relationship with 'Finance.' They are joined on Finance[Transaction date] = Calendar[date].
Finance contains transactions from individuals, there might be multiple for each individual.
I want to know how I can display a count of transactions by year for a selected individual (or individuals) from the 'Finance' table on a bar graph axis in a way that the dates start at the point of their first transaction, rather than the first date in the calendar table.
I'm open to changing the model, so any way of achieving this independent of my current setup is welcome. Any help much appreciated.
Im not quite sure this is what you are looking ,
If you want to show numbers on your whatever visualization you can add it from here
it displays numbers accordingly

Power BI Table w/ Slicer Where Other Columns Adjust Parameters Based Off Selection

I have the following Power BI table example for an operating expense report that uses a slicer to filter the first column named "Actual". This is to see the operating expenses for one month compared to the budget figures for the year. It also compares the year-to-date and annual figures. How can I create dynamic columns that change based on the slicer selection? These additional columns are not shown in the pic below but included in the last pic. The Budget column below was just created as an example to show what it should look like.
I set up a star schema with several tables shown below. There's only one expense fact table used and the slicer only works for the first column as previously stated but I need all the other columns to use different parameters and adjust based off what's selected in the slicer. The last image is an overview of the info and the parameters for each column. I tried creating new columns with measures for the budget to see if I can get that going but can't figure out how to make it adjust with the slicer selection.
I'm not sure if I should be using separate queries for each column or can this be done using the one expense table. Hope this isn't too confusing. Please let me know if more info is needed.
If I understood what you wanted correctly I think I solved your problem.
I was able to create the following:
I did not use all values since I did not want to type everything, if you provide some test data it is easier to replicate you dashboard.
This matrix (so not table) allows you to filter for Date (if you so desire, you can always show all date's in the matrix) Book and AccountTree.
The way this is done is by putting the address column in the ROWS for the matrix, Putting the Date column in the COLUMNS of the matrix and putting your values (actual, budget, variance) in the values of the matrix.
For the date is used days, since it was easier to type. You can always use weeks, months, quarters or years.
For this to work you have to create the following relationships:
Hope this helps.
If not, please provide test data so it is easier to try and solve your problem.