Custom Format not showing on visualiser? - powerbi-desktop

When I apply a custom format to a field in my power bi model it does not apply same format to my visualisers. What additional settings must I apply?

I think I have found a workaround.
I had to simply wrap all my DAX measures with:
FORMAT([Name of Measure], "#,##0.00")
However, when I deploy my Power BI model to the online service, then the customer format takes effect. Whether I explicity wrap my measures with FORMAT([],"#,##0.00") or not. I have to wrap my measures with the formatting I want to make it display formatting on my visuals, when I work with a local .pbix file.
**** Disclaimer, perhaps forcing a FORMAT([MEASURE], "#,##0.00") is not the best solution, because you will further have to wrap this to ensure that BLANKs remain BLANK ...
VAR result = CALCULATE(SUM(Sales[SaleAmount]))
RETURN IF(ISBLANK(result), BLANK(), FORMAT(result, "#,##0.00"))

Related

Creating report based on input form in MS Access

I am currently developing a database to monitor my employees' work. Yet, MS Access is new to me and I encounter a fundamental problem when creating reports.
I wish the system can generate reports based on the values of an input form. Say, I would like to check Peter's work in January, I could simply enter:
Name: Peter
Month: January
Then the Access would be able to generate a corresponding report. But I am not sure how it works. And I am thinking of three possible approaches.
(1) Input form -> Query -> Report
I look up youtube and learn how to build an Access form that passes a parameter value to a query. And then I can click the Create Report button.
(2) Input form -> Report
Not sure it works or not. But I learned a bit VBA which may be helpful in this case.
(3) Export to Excel
Export to Excel might be a good option. I can use various functions and filters to select the information I want.
Sorry that my question is being abstract. Any help is appreciated.
there are many ways you could achieve this.
One way (it may be the most efficient or not depending on your query / data you need to output in the report).
Build the query.
Build a report with its record source based on the query.
Build a form with input controls and a button.
With the button you are going to open the report. In the open statement of the report you are going to specify the controls as filters to some of the fields retrieved by the query.
Example:
Private Sub POrdine_Click()
On Error GoTo Err_POrdine_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "EmployeeWork"
stLinkCriteria="EmployeeCode=" & Forms![frmNameOfForm]![cboEmployeeCode] & " AND WorkMonth=" & Forms![frmNameOfForm]![cboWorkMonth]
DoCmd.OpenReport stDocName, , , stLinkCriteria
Exit_POrdine_Click:
Exit Sub
Am assuming the two comboboxes are going to pass a numerical value, the employee code (which would be a primary key) and the value of the month. Build the queries that feed these controls so that you may see the employee name and the month name. If in doubt just ask.
Notice how this approach may not work well for reports based on large amounts of data.

Sharepoint 2013/2016 Calculated Column stops calculating

I have a calculated column in SharePoint On-Premises that shows the number of days till a due date which works perfectly for a day or so then stops calculating, but if I go to the list settings and click the column and click ok then it calculates again?
Has anyone experienced an issue similar to this. I had this issue in both 2013 but within a few weeks moved to 2016 and still the same issue.
I've tried " " blank and also "" empty so not sure if that is causing the issue??
Is it a problem with the formula?
Here is the formula:
=IF(ISBLANK([Due Date])," ",
IF(ISERROR(DATEDIF(NOW(),[Due Date],"d"))," ",DATEDIF(NOW(),[Due Date],"d")))
Calculated columns cannot contain volatile functions, which includes those that depend on the current date.
The values in SharePoint columns--even in calculated columns--are stored in SharePoint's underlying SQL Server database.
The calculations in calculated columns are not performed upon page load; rather, they are recalculated only whenever an item is changed (in which case the formula is recalculated just for that specific item), or whenever the column formula is changed (in which case the formula is recalculated for all items).
If you need to show a dynamic value that changes with the passage of time, you have a few alternatives.
Client-Side Rendering
Consider using client-side rendering which lets you use JavaScript to dynamically determine how records in a list view are displayed. This JavaScript runs upon page load, so it can handle current time-dependent values much better than a calculated column.
To use client-side rendering, you create a JavaScript file that controls how the view displays. You upload that file to somewhere on SharePoint where people will have at least Read access to it, then edit the list view web part that you want to display differently and set its "JSLink" property to point to your JavaScript file.
Check out this answer for an example of using a JSLink file to spoof a dynamic date field.
Microsoft also provides some documentation here but I think they do more work than is necessary (creating an entire new list definition project in Visual Studio for their example instead of just creating a JSLink JavaScript file for an existing list).
Other Options
A few other options are mentioned in the older question linked above:
Conditional Formatting: You can apply conditional formatting to highlight records that meet certain criteria. This can be done using SharePoint Designer or HTML/JavaScript.
Filtered List views: Since views of lists are queried and generated in real time, you can use volatile values in list view filters. You can set up a list view web part that only shows items where Created is equal to [Today]. Since you can place multiple list view web parts on one page, you could have one section for today's items, and another web part for all the other items, giving you a visual separation.
A workflow, timer job, or scheduled task: You can use a repeating process to set the value of a normal (non-calculated) column on a daily basis. You need to be careful with this approach to ensure good performance; you wouldn't want it to query for and update every item in the list if the list has surpassed the list view threshold, for example.
To expand on the Filtered List Views option, you can have a view that shows only items that are due within a certain number of days. For example, you can display all the items due within 7 days by filtering where the Due Date field is less than [Today]+7 and Due Date is greater than or equal to [Today]. You could also sort the view to show the items with earlier due dates closer to the top.

Remove a button in SuiteScript

I need to be able to remove the delete button when today is greater than a particular calculated date.
There are 2 ideas I had and issues with each:
1 - Set a custom field on the record for the particular calculated date. Then use a workflow action of Remove Button where the custom field is <= today. My issue is I am wondering if there is a way to get "today" because I expected the condition to change allowing me to do that. I tried to use a formula and can't find Now() as a valid function listed.
2 - Workflow are truly scripts in the background. That means the Remove Button should be available in API. Therefore, my idea was to do my conditioning in suite script and then call this function. However, this function also does not exist in supported form. Has anyone hacked this to find what the function that is called in Remove Button is?
If we can get either idea to work, or if you have a third I haven't thought of that accomplishes the same task, that would be great.
I figured out my own answer. In case someone else ever needs this (as I didn't see anything like this on stack overflow), here is how to do option #1:
Save the value to a custom field - custbody_block_dlt_date
In a workflow, use the Remove Button function and use a formula condition
The condition is: {custbody_block_dlt_date} < sysdate
"sysdate" is the way you can get "Now()" or "today" in the condition
An alternative could be to create a User Event Script, on the before load function, get the button object then use the .setVisible(visible) method to hide it based on a date criteria, you may also want to set other restrictions based on roles that allow certain individuals to still be able to delete the record, like high positioned accountants. That avoids creating unnecessary fields on your records, while still providing the functionality that you desire. This could easily be done in < 4 lines of JavaScript.
See nlobjButton for examples.

ReportExport duplicates a row when exporting to Excel (not to other formats)

I am using tablix and group my entries by one of the properties. I have some trouble with SSRS when exporting my report to Excel. The very first row of each group is added to the end of its group.
This only(!) happens when exporting the report to Excel, exporting to any other format will leave my table the way it should be:
Thank you for your help!
I see that this is an old question but I have the same problem and I've been able to solve it just changing the Visibility property of the different tablix components.
In my case I have this.
Row Visibility: "Hide" and also set "Can be toogle by" with the parent group.
Group Visibility: "Show".
Each textbox of the detail row Visibility: "Show".
It looks like it is not removing dupes for you in the grouping that repeat. Are you doing a regular grouping with property or a function? There are two solutions for this:
Ensure your dataset is having distinct values (even if you think you are certain). If this is standard 'select' statement to a SQL Server just add Select 'Distinct' and your values.
I would try maybe making the properties in the table that are in the lowest level, shown as '[Details]' generally in the design section under 'Row Groups'. Change the properties to be something like:
[Max(propertyb)] and [Max(propertyc)]
This is not needed generally as the grouping should be taking care of this. But in cases where it is not it is an extra level of logic may fix the issue. You also need to be aware depending on your grouping logic that if it is not grouping properly you may get the same result for that many rows. This would not be as advised as it is more of a hack to get what you want, not an elegant solution.

Can I create my own formula for calculated field in Sharepoint 2010 using C#

I want to create a programmatically calculated field for Sharepoint 2010 using Visual Studio 2010 in C# language.
Is there a way to set a formula that will call to my own function and return a result back to the field?
My scenario:
let's say I want to create a field that always returned the sum between two other fields,
but I don't want to use something like "=sum([filed1],[field2])".
I want to call to function "calc2Fields()" and return a result.
Is it possible?
No, it is not possible. By changing the formula you are not adding any internal logic, so the field will not know what to do with your function. You can however build a custom field and incorporate there any logic you need. Of course it is not going to be identical to the built-in calculate field, but then you can add your own functions.
You will have to create your own custom field with this logic in.
Customizing the User Experience of SharePoint: Custom fields deep dive

Resources