How to take values of two different rows in Power BI? - powerbi

Example: Table name - Test
Name Value
A 10
B 20
A1 30
B1 40
A2 50
B2 60
I want to make a table where I can put both values together and for only one name like below:
For name A it will take value 10 but I also want to take value 20 exact beside the value of A. Similar for A1 and A2.
Basically, I don't want names B, B1, B2 to be appear in the table but I want their values to be appear.
I know this scenario is awkward, but I have to do as per the requirement I got.
Name Value Value
A 10 20
A1 30 40
A2 50 60
If anyone knows any DAX function for this, please let me know.

Thanks for updating the sample data although it's not explaining the original data I guess. To apply logic, sample data is important. Anyway, I am giving a video link here I created based on your given data. You can take it only as a reference and apply your own best-suited logic based on your data.
Find the video Here

Related

Cant get my if Statement to work correctly

I'm trying to make it so that when X is selected it then calls another set of code. for example
Main Selection is Type of Settlement( 4 choses ) City2, Village, Town, Hommlet. this is in a drop down in a Name Range. however this really isn't linked to anything, and should affect any of the other outcomes.
part 2 :
=SORTN('Data Sheet'!D5:E17,1,0,'Data Sheet'!E5:E17,FALSE)
Here i have it select from a list of Races ie Human, Dwarf, Elf Ect. along with a % of chance that Race is selected. there are 3 types that will pop up and some other formulas for calculated % of each.
Hommlet TRUE
| Hommlet TRUE
What Type of Settlement?
Population 54
Races and Purcentage Within the Setttlement
% Race # of
Majority Race 91 Half-elf 99 49
Secondary Race 6.03 Genasi 3
Tertiary Race 2.97 Firbolg 97 1.6
3rd on and here is where the issue is. If the Race is "Human" THen is needs to pick from a 'list of Human names. A data base list of name i have.
=If(N7="Human",INDEX('Name Lists'!B2:B15,RANDBETWEEN(1,COUNTA('Name Lists'!B2:B15))),"None")
here is the test i did to insure it would work before i embedded more into the the If formula. i also did a logic test to see if when Human Appeared it would come back TRUE, but it always returns False. if I type the word Human in another cell and Direct above code to that cell it works.
check out thew above

Using IF statments and Now() together

I am trying to make a simple logic on google sheets but there is some error. I want to 3 check boxes and when they are marked current time is saved.
so far i am using these three statements
=if($B$2=TRUE(),NOW(),0)
=if($B$3=TRUE(),NOW(),0)
=if($B$4=TRUE(),NOW(),0)
b2, b3 and b4 are cells addresses for check boxes. The problem i am facing is when i check B2 it gives me the current time. But when i check B3 it gives me current time and also changes the time of B2 similarly when i check b3 it changes the time for all three to the current time.
Why is this happening and what could be the probable solution.
Thankyou in advance
You cannot get a permanent timestamp with a spreadsheet formula, even with a named function or an Apps Script custom function, because formula results refreshed from time to time. When the formula gets recalculated, the original timestamp is lost.
The easiest way to insert the current date in a cell is to press Control + ; or ⌘;. See the keyboard shortcuts help page.
You can also use an onEdit(e) script to create permanent timestamps. Search this forum for [google-apps-script] timestamp to find many examples.

How to sum all values in a region but only if the row is classified to be of a certain type in Google Spreadsheet?

I am working on a work breakdown / Gantt chart type of spreadsheet where I need to know the number of hours planned for certain resource types during a certain period.
An example spreadsheet might look like this:
I know I can do something like =SUMIF($C$3:$C$8, "Dev", D3:D8) that will give me the sum for all things in row D3 to D8 when the resource type is "Dev", for example the value in cell D10. Similary =SUMIF($C$3:$C$8, "Tester", F3:F8) will give me the number 6 in cell F11 and by doing =SUM(D10:H10), I will get the number of hours for Dev in cell H13 and similarly for H14 for the Tester Hours sum.
I am trying to eliminate the middle steps for summing first each column and then summing again from the resulting data from D10 and H10, etc.
I know =SUM(D3:H8) is possible, but this will not allow me to differentiate the Dev Hours vs Tester Hours. I am unable to do something like =SUMIF($C$3:$C$8, "Dev", $D$3:$H$8) for some reason to get me the 14 hours I am expecting for Dev.
I tried multiple things using ARRAYFORMULA and SUMIF and that too didn't work out.
Anyone know if this is even possible without doing the intermediate step?
try:
=INDEX(SUM(IF(B3:B8="dev", C3:G8, )))
or:
=SUMPRODUCT((B3:B8="tester")*C3:G8)

Making two IF statements in a manual input cell which reference two different cells

Currently, I have Data Validation for cell E4, stating formula =IF(E4>1,””,1). This prohibits the user from entering any number other than 1 or zero.
I need the user to manually enter the number “1” in cell E4 if a particular action is accomplished (a numerical checkbox, essentially).
I also want the value of cell E4 to read “1” if cell B4 reads the number “3”.
I’ve read several examples of nested IF statements and can’t find any that reference two different cells to decide the value of another cell.
Can I make nested IF statements in Data Validation? I haven’t been successful in doing so.
The two formulas I need to affect cell E4 are;
IF(E4>1,””,1)
and
IF(B4=3,E4=1,””)
Any help is much appreciated.
You just need an OR statement.
=IF(OR(E4 > 1, B4 = 3),””,1)

How to write a correct D3 string for a custom Metric in Apache Superset

I just created a simple table in apache superset, which contains different columns. And i have a two columns, which shows:
amount of bytes
rows count
But superset shows them similar:
column of bytes shows like 461G
column of rows count also shows like 1.8G
It may confuse users, and i want to show a rows count like 1.8B.
In manual is written, that i can create my own metric with needed format, using D3 syntax - https://github.com/d3/d3-format/blob/master/README.md#format. But i can't understand how to write it correctly.
Can you show me example of a d3 string to change 1.8G to 1.8B or 1.800.000.000?
In your case you can just type ".01s" into the D3 entry in your metric setup. This will give you 1.8B for 1,800,000,000 and 1.0B for 1,000,000,000