Merging Column results to as a parameter in paginated reports - powerbi

I would like to separate Dublin to other cities like Manchester, St Albans (grouped as UK). How should I do this? There's no country data for this
I have tried adding the city from query designer, and editing the available values as "specify values" is not working

Can you create a new DAX measure column , with a condition such as
NewCountryColumn = IF(Table[Location] = 'Dublin', 'IRELAND', 'UK')
Then you'll see a new measure column, which will have IRELAND for DUBLIN and rest all will be shown as UK , use this column to do your filter.

Related

How to display the selected country name from slicer when there is no data for the selected month and the selected country in power BI with the DAX

I have a table with the Country and Date columns.
I have a slicer with Country and Date, now as I select the slicers for UK and May-21, it shows blank as the data is not there for May-21.
Now I always want to display the selected country whether there is data or not. I tried creating a measure using DAX, REMOVEFILTERS, and many other things but it's not working.
Any help would be appreciated. Thanks.
use this code :
SELECTED COUNTRY =
var __coutries = CALCULATETABLE(values('your table name'[Country]), ALLEXCEPT('your table name','your table name'[Country]))
RETURN
IF(COUNTROWS(__coutries) == 1, __coutries, "")
this article reveals how to manage the familly of allxxx functions.

How to create a calculated column in PowerBi to achieve the below?

I have the data in the following format.
CompanyID Company Name
1 Nike
2 Adidas
3 Puma
I need to create a column and use it in X axis of a line chart or any visual for that matter in such a way that if a user from Nike logs in, in the visual he should "Nike" instead of companyID. But, for others he should the CompanyID.
Just add a new conditional column in Power Query or a computed column in DAX and use it instead of Company Name.
With Power Query:
With DAX:
Custom Company Name DAX = IF(Companies[CompanyID] = 1, Companies[Company Name], CONVERT(Companies[CompanyID], STRING))
Report data:
Report visuals:

Power BI - Filter table using slicer to match within concatenated column

I've looked all over and can't find a way to do this.
In the table, I have all postcodes throughout the UK and a calculated column that concatenates from another table the products' that have been purchased in that location.
I need to filter the table to hide rows where the value selected in the slicer is in the concatenated column. I think this needs to be a measure and have tried using CONTAINSSTRING but nothing seems to be working.
Latest measure that I have tried is:
=IF(CONTAINSSTRING([Concatenated Values],[Selected Slicer Value]),"Hide","Show")
Does anyone have any ideas?
Example tables and expected results:
You can link the "another table" (the one with the products (not concatenated) per area) to the Area table.
Just change the filter option to: cross-filter direction: both
Then you can use it in your slicer.
Follow these below steps to achieve your requirement.
Let-
Your Slicer Table name: Table1
Your Details table name: Table2
Step-1: Create this following measure in Table2
show_hide_this_row =
FIND(
SELECTEDVALUE(Table1[products]),
MIN(Table2[products]),
,
0
)
Step-2: Add visual level filter using measure "show_hide_this_row" as below-
The output will be as below-
This functionality only works perfect when single selection is enabled in your slicer.

Create table comparing Two Queries with identical fields/field names

I would like to create a table to compare Month To Date (MTD) Vs YTD Sales data metrics
I am using two queries:
1st query = YTD Sales data (Two fields: Sales and Quotes)
2nd query = MTD Sales Data (Two Fields: Sales and Quotes).
Each query has the same field names, just different data
I would like to output a table like the following
How to I create the above table? At the moment I can only create a table like the following:
The latter 1x4 table only works if I appropriately name the fields. But definitely isn’t what I want, because with enough fields, the table could go on forever.
Any help would be appreciated
In the query editor, create a label column for each table that labels what they are and then append the two tables together so you get something like this:
Then you can create a matrix visual with the Label column in the Columns field and the Sales and Quantity columns in the Values area.
Make sure you've switched "Show on Rows" to "On" under the Format > Values section of the Visualizations pane.

Dax: How to apply filter function on a column?

I am trying to create a report and i have a table of data which is having project name,pro id,emp name,id, location(off/onsite) like all are basic info about the each employee.
I am using RLS so that when ever a person can login to this report he can view their own personal data.
When i login to this report, then i can able to see the project id's which are having under my list.
Now i am trying to show the basic emp details in a table like as emp name, id, role and location.
But in table i can see the only value of the person who login to the report.
I cant see the rest of employees which are belong to the same project id and their info in table.
I have tried a dax using calculated table funtion as below for only single pro id by using NEW TABLE option.
Table =
CALCULATETABLE(
SUMMARIZE('Basic Info','Basic Info'[Employee ID],'Basic Info'[Employee Role],'Basic Info'[Employee Name]),
FILTER('Basic Info','Basic Info'[Project ID]="C.0010978"
))
And it is giving the output for that perticular project.
But if i remove that hard coded pro id and put column of the pro id from table as
Table =
CALCULATETABLE(
SUMMARIZE('Basic Info','Basic Info'[Employee ID],'Basic Info'[Employee Role],'Basic Info'[Employee Name]),
FILTER('Basic Info','Basic Info'[Project ID]='Basic Info'[Project ID]
))
then it is not filtering the values as the projects filtered from the slicer as show in above image.
It is showing all the emp names and their data.
Any suggestions.
Thanks in advance,
Mohan V.
You cannot use slicer values in a calculated column. Calculated columns are evaluated during the data load and are not responsive to any visuals, filters, or slicers.
You may want to try using a measure instead of a calculated column.
Try searching the web for "power bi column vs measure" for more info on how each one is used.