Matrix column based on slicer selection in power bi - powerbi

I have 2 dropdowns called MENU 1 and MENU 2 , both created using column pagename
Now i have to create a matrix where MENU1 and MENU2 should be columns and count of visits, count of visitors, count of downloads should be values.
The challenge here is if i select some value in dropdown MENU1 and dropdown MENU2, then same should reflect in matrix column and count of visits, count of visitors, count of downloads should be updated accordingly based on my dropdown values selection
I have tried creating measure using selectedvalue function for the value selected in slicer but cannot use measure in mateix column

Related

Show filtered data when no value is selected in slicer in power bi

I have two tables, once for slicer and other one is for details table. The details table have a InvoiceDate column where some rows have blank InvoiceDate. The slicer table looks like below:
The slicer will only show value of of ID 1, like below.
Initially I want slicer to be un checked and the data should show only rows where InvoiceDate is Blank. Once User select the Slicer as Include Invoiced Records, it should show both full details i.e. Rows with Blank + Non-Empty dates rows.
There are two other ways of doing what you want that are probably more 'correct' but I'll also describe a way to provide the behavior you describe.
Option one: Delete your second table. Add a calculated column to your details table as follows:
Invoice Status = IF (ISBLANK([Invoice Date]) = TRUE(), "Not yet invoiced", "Invoiced")
Create a slicer using [Invoice Status] and simply default it to show 'not invoiced.' If users want to see the invoiced records, they just check that box in the slicer as well.
Option Two: Use Bookmarks and buttons to produce the desired effect. Create two buttons, one that says 'Include Invoiced Customers' and another that says 'Hide Invoiced Customers' -- create two bookmarks where one has the invoiced customers filtered out of the visual and one where the invoiced customers aren't filtered. Set each button's "Action" to the appropriate bookmark.
Option Three Keep your 'slicer' table. Let's assume it's called 'Invoice Filter Selection.' Create a new measure:
IncludeDetailFilter =
IF (ISFILTERED('Invoice Filter Selection'[Value]) = True(),
1,
IF (ISBLANK(MAX(InvoiceDetails[Invoice Date])) = TRUE(), 1, 0)
)
When the slicer has a selection, it will be considered 'Filtered' and you will pass into the first branch of the IF where the measure always evaluates to 1. When the slicer isn't selected, the measure will evaluate to 1 or 0 depending on whether or not there are any values for Invoice Date in the row. Add this new measure as a filter on your invoice detail visual.
Unchecked:
Checked:
Hope it Helps.

Not Able to filter the Table Power BI

I am learning power BI , for one of my requirement i want to filter table based on the selected value from the slicer and show it in different slicer.
So, here there are 4 slicer and based on selection of one slicer i have to populate the data for the 2nd.
My Table Looks Like
id Name ParentId
1 A null
2 A.1 1
3 A.1.B.1 2
So, i have only 1 table where i have to search the element by id -> parentId and then populate it in the next slicer.
e.g: if We select A then in the next slicer we should show A.1 since , id --> 1(A) = ParentId --> 1(A.1)
I tried to create separate table and then link the id with parentid in the mapping section , this concept is working but not the problem is .
If we select A then in 2nd combo A.1 and A.2 is displaying , but as we click on A.1 on the 2nd combo and then try to click on the elements on 1st combo here in our case A , then the filter is not working properly .
If appending the elements from previous selection + New selection
e.g:
Slicer 1 Slicer 2
A -- (1,2,3)
B -- (4,5,6)
Now , after clicking on A[1st Slicer] it shows (1,2,3) [2nd Slicer]
After clicking on 2 [2nd Slicer] --> showing some elements in [3rd
slicer]
But, now again click on B [1st slicer] --> [4,5,6,2] (Wrong value)
since we selected 2 its appending with the new selection only if we
click on the 2nd slicer.
So, as an alternate solution I tried to filter the selected value which is measure from the table and then show it in the list.
My expression:
Table = FILTER(TableA, TableA[id] == Tableb[selectedId] )
Tableb[selectedId] --> is measure
Table = FILTER(TableA, TableA[id] == "8DE04141-E5B6-49E1-814A-ADB4C6FF5DCF" ) --> selected Id
1st statement is not showing any value but the 2nd giving me the result when i am hard coding value , please suggest me what i can do here.
i want to filter table based on the selected value from the slicer and show it in different slicer.
You don't need DAX for that. You just set up the correct relationships and set filters and slicers in the report.

Group 10 columns of data to gain distinct count of rows Power BI

I'm trying to display all of the distinct values within this table (there are many other columns in this table) and show how many rows each distinct value shows in.
I have tried to use group by but this does not work. It needs to be filterable by country from another column but i can do that by page filter.
I am trying to show what the top 5 associations are in terms of appearance.
enter image description here
Put the 10 columns in a Table visual. Then create this measure and add it too. Then sort descending on Distinct.
Distinct = COUNTROWS('Your Table Name')
To see only the Top 5, go to the Filter pane, and pick the first column and set the Filter type to Top N, and then Top 5 by the Distinct measure.

Hide item in slicer from end user (Power BI)

I have a data set on sales with a column named "Processes". This column has four entries: "Budget", "Forecast 1", "Forecast 2" and "Realized".
I have then inserted a slicer on this column, and I would like to always have "Realized" selected and then removed from the filter such that the end user
only can filter on "Budget", "Forecast 1" and "Forecast 2"
can't deselect "Realized".
Is this possible?
There is no direct option for your purpose. But you can achieve the requirement with some workaround as stated below-
Step-1: Create a new Disconnected (not related to any table) table new_slicer_table_name contains only three value "Budget", "Forecast 1" and "Forecast 2".
Step-2: Create a slicer using Processes column from that new table. You will have 3 values in the slicer list now.
Step-3: Put a note below the slicer like "*Realized Default Selected"
Step-4: Now create a measure as below-
show_hide =
var current_row_process = MIN(your_data_table_name[Processes])
return
IF(
current_row_process IN ALLSELECTED(new_slicer_table_name[Processes])
|| current_row_process = "Realized",
1,
0
)
Step-5: Add a visual level filter for the last created measure show_hide and show values only when show_hide = 1
This will now give you your expected output.

How to add Filter to Slicer to display the calculated Measure based on selection using Power BI

I am totally new to Power BI and struggling with Slicer. I have the below requirement:
I have 4 columns Starting From, Destination, Distance KM. For this, I need to add a slicer. If the user clicks on Distance KM, then the chart has to be updated with Distance KM values. Now here comes the trick. I also want to display a column Distance in Miles based on the Distance KM calculation(the KM has to be displayed in Miles). So, whenever user clicks on Distance KM(in slicer), it should show the chart with KM data, if the user clicks on Miles(in slicer), then the chart should be populated with Miles information. I need to do this using slicer in power bi. Trying to achieve this since a while but couldn't get through it.
Please help me out
You only list three columns after stating your data has four, but I believe this should work:
You need to create a new table for the slicer. Within the Home tab select "Enter Data". Enter the values you want to be able to select from (I named the table DistanceSlicer). Load that table and create a slicer with it.
Now you can create a new measure based on this slicer selection. Within the Modeling tab select "New Measure".
SelectedMeasure =
IF (
VALUES ( DistanceSlicer[Measure] ) = "Kilometers",
SUM ( Table1[Distance KM] ),
SUM ( Table1[Distance Miles] )
)
Now use this measure in your table/chart and it should update based on your slicer selection.