I am trying to add two currency columns in a calculated column but am getting a #NULL! error.
This seems pretty straightforward but its my first time doing this in SharePoint.
SharePoint 2010 with Excel Services available.
Have create List with required columns:
Approved Value column Type = Currency
Pending Value column Type = Currency
Total Value column
Calculated (calculation based on other columns)
Type = Currency
Formula: =[Approved Value]+[Pending Value]
The values in other columns are indeed currency, but the Total shows #NULL! for all items.
I can't see anything done incorrectly.
What should I be looking for to resolve this problem?
Try using the ISBLANK function to previously check if any of the value is null.
Reference: ISBLANK function
I ended up using NZ(Value, 0)
=NZ([Approved Value],0)+NZ([Pending Value],0)
Though not sure how NULLs ended up in field or why SharePoint couldn't deal with them without this special treatment.
Related
In Power BI, I need to create a VLOOKUP alternative. From the research I've done, this is done with the LOOKUPVALUE function, but the problem is that function needs one specific SEARCH ITEM, which isn't super helpful in a VLOOKUP type scenario where you have a full column of values to search for?
Given these two tables, connected through the user_name and first_name columns:
...what's the formula needed in order to create a new column in the Employee_Table called phone_call_group by using the names as the search items in order to return the group they belong to? So how can I end up with this?
(Forget that the entries in each table are already sorted, needs to be dynamic). Will be back tomorrow to review solutions.
In Power BI you have relations between tables instead of Excel's VLOOKUP function.
In your case you just have to create a one-to-one relation between
'Phone_Call_Table'[user_name] and 'Employee_Table'['first_name]'
With that you can add a Calculated Column to your 'Employee_Table' using the following expression:
phone_call_group = RELATED(Phone_Call_Table[group])
and in the data view the table will look like this:
LOOKUPVALUE() is just a workaround if for other reasons you can't establish that relation. What you've been missing so far is that in a Calculated Column there is a Row Context which gives you exactly one value per row for the <search_value> (this is different from Measures):
alt_phone_call_group =
LOOKUPVALUE(
Phone_Call_Table[group],
Phone_Call_Table[user_name],
Employee_Table[first_name]
)
While I am trying to create a new measure, with condition, I am facing the below error.
I am trying to create a dynamic line based on dates on my line graph. For my case, if Sheet[Date] matches to Test[Date] it should return me a value of 100.
But the error says that a single value for column 'Date' in table Sheet1 cannot be determined.
I also tried to convert the date to week with Weeknum function. But the error still persists.
Does it mean that I can not compare single values in IF condition
If there is a way to compare the dates, kindly guide me.
Sheet[Date] and Test[Date] are columns, not single values.
You need to specify which single values from those columns to compare. For example, you could compare the maximal values of those columns (within the local filter context):
MAX ( Sheet[Date] ) = MAX ( Sheet[Date] )
I have a table visual in PowerBI that summarizes work hours by employee. The first column shows the employee name.
When training managers on how to use it I want to anonymize by showing employee numbers instead of names.
I tried adding a what-if parameter Anonymous with values 0 and 1 and use IF() in the DAX of a calculated column but it is not working. It ignores the parameter value.
Person = IF(Anonym[Anonym value] = 0; Time[Name]; Time[Empno])
will always show Name.
Person = IF(Anonym[Anonym value] = 1; Time[Name]; Time[Empno])
will always show Empno.
Another option if you really need to use a column and needs it to be "dynamic" is to use a PowerQuery parameter and add a new column based on it and then create your conditional. The downside of this is that you will have to refresh your query everytime you want to change the parameter
I'm trying to obtain the MAX of a particular column in a Power BI Report and place this as a new Measure within each ROW of the same dataset. Please see the example below.
Is this possible in DAX and via DirectQuery/LiveConnection? The report is pointing to a tabular model but due to outside factors the measure must be created in the report.
Thanks
You can accomplish this a few ways. Essentially, you need override the filter context so that the MAX function isn't just running over whatever slice you're showing in the visual. Using CALCULATE or the iterator function MAXX, set the wrap the table in the ALL() function to override the context and calculate max over all rows.
= CALCULATE(MAX([Calendar`Year]), ALL('Smithfield_Fiscal_Calendar'))
or
= MAXX(ALL('Smithfield_Fiscal_Calendar'), [Calendar`Year])
To get the breakout by date, you'll need to include a Date table in your model. PowerBI makes this possible with a few different DAX options. As an example, go to your Model tab, click 'New Table' and put in the following expression:
MyCalendar = CALENDAR(DATE(2019,1,1), DATE (2019,1,10))
This is a little trivial -- you'd want to use a useful range of dates but this one matches your example above. Next, add a column to [MyCalendar]
CalendarMonthYear = month([date]) & "-" & year([date])
Go to your budget table and add a similar field
BudgetMonthYear = month([date]) & "-" & year([date])
Go into your Model view and create a relationship between CalendarMonthYear and BudgetMonthYear. This will associate every date in the date table with the particular budget row from your budget table.
Hope it helps.
I am trying to replicate the below dax calculation which worked in Power BI but throwing error in SSAS tabular model.
Account Warranty Count = CALCULATE(COUNT(dds_repairlogs[Repair Logs]),RELATEDTABLE(dds_repairlogs),filter(dds_repairlogs,dds_repairlogs[Savings Type 2] = "Warranty"))
The error I get is count doesn't work with text fields. However the field Repair Logs in Count function is kind of uniqueidentifier. Does anyone have any suggestions on how to replicate the above measure in SSAS tabular model.
Adding a little to Olly's answer:
The COUNT function counts rows that contain Numbers, Dates, or Strings - but text values are only counted if they can be translated into a number.
Uniqueidentifier is not a supported data type in SSAS Tabular models, and therefore your uniqueidentifier values are most likely saved as Texts (i.e. Strings).
Changing COUNT(dds_repairlogs[Repair Logs]) to COUNTROWS(dds_repairlogs) in your formula should fix the issue. COUNTROWS counts all rows in a table, rather than numbers in a column.
The COUNT function only counts numbers. Your error message indicates the [Repair Logs] field contains non-numeric values.
Try replacing COUNT with COUNTROWS