I have a table where I get the status of the employees tasks day by day.
As in below image I get the values(Confidential, so just entered dummy data).
Then I did unpivoted the dates column and made a copy of that and split with space so that I can get the date value.
Here I would like to show the last 3 commented values in a table visualization for each task.
Like as in above image, if the 5/31/2017 value is not available, then it should get the values of 5/29/2017 plan, 5/29/2017 actual, 5/30/2017 plan values i.e nothing but the last 3 non blank values.
Any suggestions please.
Mohan V
I think i got the solution.
I did mentioned in Top N filtering of visual level filter of fields.
And it worked for me.
Thanks for the hint #user5226582
Related
I am learning Power BI Desktop. I have a project already loaded for which I have created a
pie chart.
As you can see, the data is currently divided into two years: 2022 and 2021.
I also have data for previous years that I want to include in the chart. Unfortunately, none of these years has a high number. So I want to group them all into an "Other" category.
I've already tried using the RANKX function as described here (where I copied and pasted the formula from the comment and replaced the field name with my own) and here (where I went through the article step by step using my own field names). I used the exact format shown in both the comment and the article:
Rank = RANKX('Table','Table'[Percent],,DESC,Dense)
(Table is the table name I am using and Percent is the column I am trying to rank.)
When I added the new column to a table, though, PowerBI automatically gave me a sum calculation. This calculation gave me a 1 in each column. When I asked it not to give me a sum, it said it could not display the visual and took me back to the calculation screen.
EDIT: Thanks for your help Kevin! This is the table I tried to draw from. I am an idiot sometimes.
EDIT 2: Now I am trying to use a different field in the formula:
Rank = RANKX('FactClaimActivity','FactClaimActivity'[DirectIncurredLoss_ITD])
(This is the original field that I tried to base Percent on)
My table looks like this. (Yes, I know that 2016, 2017, 2019 and 2020 have negative values and 2014 and 2015 have $0 values. I just want to show what the data is.)
EDIT 3: This time I am also getting an error when I type in the formula, which says "A single value for column 'DirectIncurredLoss_ITD' in table 'FactClaimActivity' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."
I do not understand why it wants a single result for a formula that ranks the data points based on this field. That seems like it defeats the whole purpose of the formula.
Yet when I use the formula, I get the same result as last time! This column is in the Fixed decimal number format, and it does have many different values.
EDIT: I've found the answer
New Category = IF('FactClaimActivity'[Rank]<=2,'FactClaimActivity'[LossYear],"Other")
The formula will help you get the correct result.
I have joined an excel sheet with the world population web link from Wikipedia in my Power BI tool. When I merge these two tables, it shows me the population only from the United States, other countries have null values.
Would really appreciate the help. Screenshots provided below
It looks like your merge isn't matching the rows as you expect.
I would try to investigate if there are "invisible" differences in the columnar values:
Canada (with an appended space) will not match to Canada for example. To check for this, go into the table you are merging and select to Trim the key column.
In the table you are merging into, do the same Trim operation for the key column.
Edit: Another option is to apply fuzzy matching to the merging process and to limit the amount of fuzzyness by setting maximum number of matches per row and adjusting the similarity threshold up from 0.80 to something closer to the maximum 1.00 (= exact matching).
I think issue is left join. Try with join tables with country column to present all columns.
Click dropdown and select full outer feature and expand.
I've got an oddly set up google sheet as my data source for a powerBI dashboard. Right now my main stress point is a 'last 7 days' filter that needs to be applied. The problem is that there are multiple columns containing dates that could be in the last 7 days, in this case representing multiple steps in an email chain.
If any one of those columns contains a date in the last 7 days, then I need to capture the row in most of my visualizations and tables, but if I just use standard filters, PowerBI assumes 'AND' and displays none of the rows, since there will almost never be a row where multiple date entries are in the last 7 days.
I'm almost certain there is a way to do this with either merged columns or calculated fields, or maybe there is even something as simple as an 'OR' filter, but thus far my googling has not turned up anything. Do you know a work around for this?
Thanks in advance!
In Power Query Editor, create a duplicate column for each of your date fields.
Make sure each of the duplicated columns is in Date format and then calculate the "Age". You will get a time value. In the Transform pane, use the "Duration" function and convert to "Days". Do this for each of the duplicated columns.
Now the last step: Create a "conditional column" in the "Add column" pane, and pull all of these new columns that should now have integer values and set the condition to show "Yes" if less than or equal to 7, "No" if more than 7.
Let me know if this helps.
I have two measures, which calculate the same amount for 2 different columns (i.e. total for person and total for the site) and returns the person/site having the highest amount.
I have report level filters on both Person and site. When playing around with these filters (either person or site), sometimes the measure returns blank randomly.
i.e I filtered to a single person and got the following:
Now, when I open ANY MEASURE IN THE REPORT, and simply add a blank line or remove a blank line (it refreshes the report I guess):
The measure will now show the proper value. The fun part is, I did not change the measure at all, just added a blank line or removed it and hit enter. The problem occurs randomly for both person and site measures.
For obvious reasons, I cannot expose many details here. Please let me know if you have to look at measures, I will post dummy ones.
Any help would be appreciated, Thank You!
Replacing the RANKX(Rank = 1) filter with TOP N did the thing.
The measures were using RANKX to generate a table variable, which was then filtered with rank = 1 condition. Sometimes, the table was not having rank 1 at all, the ranks started from 2,4, etc. I am still not sure what was the root cause of ranks not calculating properly.
Using TOPN function eliminated the rank filtering thing and the measures are now functioning properly.
I'm using Crystel Reports again after not touching it for about 8 years.
I'm having this situation...
I have 1 data table, and 1 table with just day numbers from 1 to 31.
Nothing is really linked between each other.
In my report I let the user select a reference date.
From that date I grab the maximum days of the month.
The report lists a row per day of that month but there are no actual database fields inthere. Just the first 2 letters of the dayname, the day number and another formula based field showing 'yes/no' or '' depending on a main record value.
So far so good.
In the group header I was adding the fields from the main datatable which went all fine until I added fields that in the query on the sql server rely on some cases but CR just read it out as 1 singe record row with everything in it.
For some reason the report generation goes from 1-2 seconds to 30-40 once I add that field that just outputs 'X' or ''. (it represents things assigned to that user)
Other reports where I'm using the same data still generate in 2 seconds.
To get this working right and to eleminate double date records I'm stuck with 3 groups.
I think this ain't optimal and the reason for the slow down although it wasn't there at the start.
So I was wondering:
Should I go for a sub report for the day listing?
Can I feed the subreport with my date parameter?
or is there some kind of scripted way to list a row x-times without all the grouping requirements?
Synchro was right, the problem was in the actual query/view.
For some reason the view takes half a minute longer if you just added an order by to a specific field.
The "where id between 211 and 265 or id=67" has been moved from a joined view to the actual query.
Thanks for the hint, Synchro.