Show/hide columns in a matrix visual Power BI based on slicer (other table) - powerbi

I have a table with A LOT of columns. But based on the slicer selection only a few of them must be shown. Every option of the slicer must show only a couple of (different) columns. To make a slicer for the selection of the columns is not really an option, because the end-user doesn't know which columns he must see with that selection.
The columns that must be hide are only having 'null' values on that selection, so I was thinking about some IF statement in which you're comparing the amount of rows with the amount of blank values in a column (that is a huge amount of work for all the columns, but I don't have a better idea). But then I have to have a statement for show or hide and there I got stuck.
So if you know how to make this statement, or you have a better idea it would be great if you would share this. Thank you in advance!

Related

How can I force only two selection out of 5 available on slicer visual?

Can someone please help me get a fix for this please.
I want to let people make only two selection at a time, no more no less from the given options. The intention is to get data on matrix dynamic column based on these two selections.
Thanks
Avi
You did not make clear what the purpose of this exercise is and how the result should look like ("get data on matrix dynamic column"), but you could
Create 2 single selection slicers based on copies of your category column
Make sure they are not related to the rest of your data model
Get the selected rows via the SELECTEDVALUE() function
You may have to consider the case where both selections are the same.
This would be a feature of a slicer visual, but I don't know of any built-in or custom slicer visual that does this.
As a workaround you can show a warning and instruction to select two items, eg a big Card visual with red text and a transparent background in front of your other visuals displaying a measure like:
AreTwoCategoriesSelected =
IF (
DISTINCTCOUNT ( DimProductCategory[ProductCategoryName] ) <> 2,
"Select 2 Categories for this report",
""
)
Which might look like
and
You can't easily use the trick where you have the measure conditionally return BLANK because most evaluations of the measure will have a filter context with just one of the selected values.

'OR' Filtering on Columns in PowerBI

I've got an oddly set up google sheet as my data source for a powerBI dashboard. Right now my main stress point is a 'last 7 days' filter that needs to be applied. The problem is that there are multiple columns containing dates that could be in the last 7 days, in this case representing multiple steps in an email chain.
If any one of those columns contains a date in the last 7 days, then I need to capture the row in most of my visualizations and tables, but if I just use standard filters, PowerBI assumes 'AND' and displays none of the rows, since there will almost never be a row where multiple date entries are in the last 7 days.
I'm almost certain there is a way to do this with either merged columns or calculated fields, or maybe there is even something as simple as an 'OR' filter, but thus far my googling has not turned up anything. Do you know a work around for this?
Thanks in advance!
In Power Query Editor, create a duplicate column for each of your date fields.
Make sure each of the duplicated columns is in Date format and then calculate the "Age". You will get a time value. In the Transform pane, use the "Duration" function and convert to "Days". Do this for each of the duplicated columns.
Now the last step: Create a "conditional column" in the "Add column" pane, and pull all of these new columns that should now have integer values and set the condition to show "Yes" if less than or equal to 7, "No" if more than 7.
Let me know if this helps.

Is there a way that POWERBI does not agregate all numeric data?

so, I got 3 xlsx full of data already treated, so I pretty much just got to display the data using the graphs. The problem seems to be, that Powerbi aggregates all numeric data (using: count, sum, etc.) In their community they suggest to create new measures, the thing is, in that case I HAVE TO CREATE A LOT OF MEASURES...Also, I tried to convert the data to text and even so, Powerbi counts it!!!
any help, pls?
There are several ways to tackle this:
When you pull a field into the field well for a visualisation, you can click the drop down in the field well and select "Don't summarize"
in the data model, select the column and on the ribbon select "don't summarize" as the summarization option in the Properties group.
The screenshot shows the field well option on the left and the data model options on the right, one for a numeric and one for a text field.
And, yes, you never want to use the implicit measures, i.e. the automatic calculations that Power BI creates. If you want to keep on top of what is being calculated, create your own measures, and yes, there will be many.
Edit: If by "aggregating" you are referring to the fact that text values will be grouped in a table (you don't see any duplicates), then you need to add a column with unique values to the table so all the duplicates of the text values show up. This can be done in the data source by adding an Index column, then using that Index column in the table and setting it to a very narrow with to make it invisible.

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.

Merge or combine two columns in power bi

I am not sure if my title is correct one, but here is the deal:
I want to make a matrix visualization in Power Bi Desktop. I have fields: ARTICLE_ID and ARTICLE_NAME.
I would like to have both those fields in COLUMNS position in matrix data view. And I need them to be in one row, no need to drill down... because it is one and the same thing...
I need to have ARTICLE_ID and ARTICLE_NAME as two separate columns on the same level. without drilling. And also, I dont want to use concatenation or merging into some third column. is that possible? thanks
1) I started with this sample data.
2) I created a matrix and configured it as shown in the image below.
3) I clicked the forked arrows to show all levels.
4) In the Rows section of the formatting pane, I turned off "Stepped layout".
5) In the Subtotals section, I turned off "Row subtotals".
I don't know if this is exactly what you are looking for, but I think it is the closest I can come up with since you don't want to concatenate the columns together.
If they are from the same table then just drag and drop them into the columns.
The way a matrix works from my understanding in PowerBI is;
Rows are just the headings/categories of the values.
You might need to also go into the format tab, values, and make sure show on rows is on.
For example, let's say our value headings are rainy days and sunny days.
Your columns are months.
The rows will be the 2 categories.
The values will be the values.
As concatenation and "&" does not work in Power BI directquery you can use the below one:
[New_column_name] = if((table_name[column_name]="A" && table_name[column_name]="B"),"AB","NA")
Thanks,
Sachin Kashyap