What do I need to add to create a count vizualization - powerbi

I have a CSV file that has a list of wineries in one column and the state they are in, in another. What would I need to add to the data in Power BI in order to create a visualization that shows how many wineries are in each state?
For example, I have a CSV file that has 2 columns. One says the name of the winery and the other column has the state it is located in. I need to create a visual in Power BI that shows how many wineries are in each state. For instance, there are 999 wineries in California, ect.
I am very new to Power BI, so I do not understand all the codes and measures. So I am trying to figure out what needs to be added in order to show a visual like this.

Related

Power BI Map Values are not updating

I copied an old Power BI Report and gave it a new source. The new source has the same columns but updated data.
The Map of the USA on the NEW PBI report I made does not change the values by state, it gives it to max value, i.e. all the states say 4,100 instead of different number.
The filters all match, what else should I check?
If you "replace" a query by another one with the same name, the data model will be broken. What you need to do is "edit" an existing query and "paste in" the new code. You can do that by opening both queries in the PQ Advanced Editor. Of cause the new code has to result in the same column structure.

Issue with Sorting in Power BI Desktop Table Visual

I'm displaying my data in Power BI Desktop table visual using SQL Server Stored Procedure data source. I need data to be sorted in particular user-requested order (there are only 5 rows in the data output). For this purpose I did the following:
Created "dummy" column in SQL Server SP to reflect the ordering requirements (values 1-5)
Specified dummy column in Order By clause for SP output.
In Power BI Desktop I navigated to Power Query Editor and sorted data table by the dummy column explicitly.
Still, after all these steps, data in table visual is sorted differently. Please note dummy column is NOT displayed on table visual (and is not supposed to be). Also, NO manual sorting has been applied to the table visual (both Sort Ascending and Sort Descending options are blurred for the Table Visual).
How can I fix this issue?
Appreciate your help.
P.S. Here is the picture of not displaying Column Tools when clicking on a column:
https://i.stack.imgur.com/gTXFR.jpg
What you may want to try to do is select the column you want to have sorted and set it to sort by the dummy column you have created. This uses your chosen field as the display field but will sort it by your dummy field.
This is very commonly used when sorting months or days of the week where you want to see, say, a day name on an axis but don't want it sorted alphabetically but rather by the order of the day in the week.
Sample screen shot below taken from these PowerBI Docs.

How to download Power BI dataset without publishing to web

I'm using a calculated column that is an average. The problem is, the average is above the range of possible values, which should be impossible. I made a calculated column that calculates the average star rating (out of a range of 1-5) and the value on a visual is coming up as 6, which shouldn't be possible, even if all the values were 5 stars, which it isn't. So there must be an outlier causing the average to be above the range of possible values, but it isn't in the original data source which Power BI pulls from. The original data source shows me a value of 4.1 as an average, which is within the expected range. But Power BI's dataset has introduced an outlier or (data is missing) that caused the average to become a 6.
I can elaborate on the dax below, but what I want to try to do is pull the dataset down from power bi to figure out why it's calculating its average that way. Looking at the source data, the average is 4.1 and there are no outliers in the source data. So, it's not the source data that's the problem. Basically, I want to find the outlier that's causing the average rating to differ in Power BI.
Avg Rating = IF(SUM(data[Total Reviews]) = 0, BLANK(), SUM(data[Monthly Stars])/SUM(data[Total Reviews]))
Here's a screencap that shows the two
relevant columns
Notice that I had to manually calculate (aka eyeball the columns and type into a calculator then calculate manually) these two columns, which came out to ~4.6. I'm trying to download this dataset to explore it in further detail without having to eyeball the dataset, as the source doesn't show this discrepancy.
To get to the data you have a number of options.
Create a new report in Power BI Desktop, and then use the connect to PBI Dataset option to access that data, in for example, a table. You can create your own report based on the dataset in the service as well.
Access that data via Analyze in Excel, which should allow you to access the data in a pivot table using Excel
Use the Export data from the visual option, using this you can download 30,000 rows into a csv, or 150,000 in to xlsx formats
Please note, that these options may not be available to you if you do not have the right permissions in the workspace, or options have been turned off in the Power BI Admin tenancy settings.

Power BI - How to have a calculated column and place it in a merged cell?

I am new to Power BI and with the limited time given, I am stuck at how to come up with:
Below Table B-Row1 ("1/20" and "M"-Monday cell) - how to
specifically place the date measures in their specific cell and put
it in one column?
How can I merge the cells under the Total column?
How to add all the numbers from the Type1 and Type2 columns and place it in the merged cell in #2?
Any clues/direction/links on how to achieve the Target Table B below will be much appreciated.
PS. Below Table A. Current is just using Matrix Visualization in Power BI.
You can't exactly do what you are after. PowerBI allows you to rapidly put amazing visuals together however that comes at the price of lack of (easy) flexibility. You could build your own custom visual or look in App Source for a visual that does this, or build the Visual in some other tool (via custom code).
However, I'd recommend sticking with the PowerBI matrix, which will give you a cascading drill down and work out how best to align your data to it and other out of the box visuals. Once you start to delve in to convoluted work-arounds to give users data in exactly the format they request you start to burn a lot of time. Look for alternatives to tell the data's story and work with your end-user to buy in to it.
Just wanna share that I have resolved my problem not using one type of visualization, but through using 3 different visualizations in Power BI. I used:
1 Table visual for Date column
1 Table visual for Total column
1 Matrix visual for the Code+Type mapping and counts
I also used DAX function to get the Date format and another DAX function used for both Total and Code+Type counts(to filter data according to the specified date).
Thanks for the response, #Murray and #RADO.

Changing the query data source to new updated sheet questions

We are utilizing an excel monthly report in our power bi project that has added measure columns, and we keep the sheets the fields pull the data from in one folder. When we get each month's updated excel sheet, would we be able delete the old one, add the new report to the folder with the exact same name as the old, and refresh the power bi query to use the new updated data? All the column headers would remain the same, the only thing that would be changing is maybe the amount of rows and the data within them. If we were to keep all the names the same, the only thing changing is the data sheet itself (not the column headers just the data) would the added measure columns remain and work? The measure columns act as column data multipliers and filters, and it would be a pain to make new ones each month.
Thanks
Yes. If the file path and filename and sheet/table name all remain the same, Power BI won't know the difference and you shouldn't have trouble if the columns and headers stay consistent.
Additionally, if you don't want to rename the file or delete/move older files from the folder, you could do a Load from Folder query and sort by date created/modified and grab the top row instead of specifying the filename.