Creating value indicator measure in Power BI - powerbi

I have a Column A in a table that has valid values and blank values. I want to create a value indicator measure in power BI. I am not sure how to do it as I am new to Power BI.
in sql, we usually do,
case when column A <> '' then Y
else N
So, how do we implement this in measure in power BI? Could you please help me out? I am stuck here.

Add a calculated column with
Indicator = IF( ‘Table‘[Column A] <> ‘‘, “Y“, “N“ )

Related

Power BI Slicer on Table 1 to calulate new column on other Table 2

I have a table Numbers and a slicer "num" to filter to a single number.
Then I have a second table Exhibitors with their exhibitorID and size.
Depending on their size I need to rate them. The rating has to depend on the slicer "num":
I need to do this with a calculated column (Expected outcome in GREEN).
Trying something like this did not work:
Calculated Class =
IF(Exhibitor[Space] >= max('Numbers'[num]), "A", "B")
Can someone help me with that calculated column?
Since Calculated Columns are populated at Refreshing the data, Slicer have no impoact on Columns. Only Measures can be affected by Slicer.
So it has to be a complicated Measure for my Visuals.
Thank you.

Replace values in cell with DAX coding in Power bi

I have my data(file name - Data) which I have imported in power bi with a column named values
values
ext
int
safety_int
outside_training
gap_fill_int
so it is a large data, and it contains more than 2k categories , what I want is, to create a new column in power bi where blanks should be replaced with target_emp, and all other values(ext,int,gap_filling_int etc.) should be replaced with non_target_emp.
Please help me to do that in power bi.
In powerbi transform ->
Add Column:
if Text.Trim([category]) = "" then "target_emp" else "non_target_emp"
You could add a conditional column in the data model (sorry that I dont have an English screenshot for this):
Add column
Select conditional column
Add criteria to selection
#1 DAX
calculatedColumn= SWITCH(TRUE(), Data[Column1]=BLANK(),"target_emp", "non_target_emp")
#2 using PBI's binning
go to report view->click on the table->column name-> New Group

Can we calculate a measure with percentage in Power BI matrix

Can we create a percentage measure in power BI over a matrix visual.
You can create a measure in your table using DAX below -
% Percentage = DIVIDE([1],[0])
Then change the format of [% Percentage] to percentage
You can create this below measure-
%percentage = DIVIDE(your_table_name[1],your_tabl_name[0])
Now change the Type of the Measure as % from the top menu.
Try this, if it helps. I am throwing blank if denominator is blank else it's value will become invalid:
Create a measure and append that next to your matrix.
Measure = IF(COUNT(Sheet1[Denominator])<COUNT(Sheet1[Numerator]), BLANK(), DIVIDE(SUM(Sheet1[Numerator]), SUM(Sheet1[Denominator])))
Later you can change formatting from right side, below visualization, where you see small dropdowns next to column/row/values names > Show values as.
Let me know if it solves your problem.

How do I create a total_sales column in power bi when I have price_per_unit and quantity_ordered

This has got to be the simplest question ever, but after seeing a half a dozen sites I can't figure it out. How do I create a total_sales column in Power BI when I have a price_per_unit column and a quantity_order column?
All I want to do is make a column that says "price_per_unit * quantity_ordered" but all I get are errors about the column not existing, or the SUM calculation wanting a measure, or some such thing.
Thanks
Create a calculated column (not a measure) on the table those two columns are part of and definite is like
Total_Sales = Table1[price_per_unit] * Table1[quantity_ordered]

DistinctCount On A specific condition In Power bi

I need to take the DistinctCount(InvNumber) of a InvNumber column by creating a new measures that is #NoofInvoice,
I need to show that column In MY report, but Column #NoofInvoice I want to take on Condition that If(OrderType='SALES' and OrderType is a column which contain two values SALES and RETURN or then only I need distinctcount(InvNumber)) in Power bi
How about if you create a new measure called "No. of Invoices" like this:
No. of Invoices = CALCULATE(DISTINCTCOUNT(InvNumber), FILTER(Table_Name, 'Table_Name'[OrderType] = "Sales"))
Let me know how you go with it! :)