Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I'm trying to create a new column that should be populated with a certain number based on the contents of several other columns.
What I'm looking for is something like this:
If [COUNTRY] equals Kazakhstan AND IF [COMPANY] equals Alltel, then "1"
Else If [COUNTRY] equals Kazakhstan AND IF [COMPANY] equals VIP, then "2"
But i cannot find such a possibility in "Add conditional column". (see picture)
And when I try to use the Advanced Editor, I cannot find any syntax that covers this scenario.
Does anyone have a solution for this?
Hi @GilbertQ
The new measure is not working fine as the report contains columns from some other tables like T1, T2.
Can you suggest on this
Hi @GilbertQ
Its difficult to post data as it is coming from two or three tables and they contain many columns. But can you explain why i am not able to put a simple condition.
Example if am i am doing (billing = "FP") it should not give at row level but at the aggregated level without being affected by other columns in the report.
How can i create a measure so that it gives billing = FP without getting affected by any dimension??
@GilbertQ Below is the error i am getting. Now i am getting the data from 2 tables project, staff and calendar table is also used. Can you now suggest on this.
Can you please explain how can i implement the below logic now:
if(billingmethod= "FP" then use Measure1 else use Measure2)
Thank you so much, it worked. I am new to learning power bi and dax. Can you please any book or online course where I can learn better and explore on myself.
Hi there
No worries glad to help out
My mate @MattAllington has a great course here: https://exceleratorbi.com.au/courses-overview/
'Wrong totals' is usually an effect of misunderstanding what the total row contains: it is not the total of the rows above, it's the result of the same measure in a different context, in this case without the row identifiers filtered.
So your measure is not a simple SUM, but you do want the total to add up. The solution in this case is to force DAX to calculate results on a row-by-row basis, you can do this with SUMX. Trying to mimic your model:
SUMX(VALUES(ProjectTable[Complete Project Detail]), [Your original measure])
or, if Complete Project Detail is unique in the Project table:
SUMX(Project, [Your original measure])
If you don' want to call another measure [Your original measure] but want to include the logic in this measure directly, it's probably safest to wrap it in CALCULATE:
SUMX(
VALUES(ProjectTable[Complete Project Detail]),
CALCULATE(<Your original formula goes here>)
)
My measure is having the above calculation. The main measure is " Pay Distribution Project" . Can you please suggest now ,where I am going wrong.
Hi all,
I have 2 measures (M1, M2) which are working fine in two separate scenarios. But now i need to combine these two scenarios.
I have to put a simple condition in a final measure (M3) using column "Billing"
M3 = If ( Billing = "FP", M1,M2)
But I am unable to use column name in the measure. Please help.
Hi @GilbertQ
I tried this but when i am using it in report its not working fine as the report contains the columns from other tables like T1, T2
Hi All
Just to give you more feedback about my data, this is what I have:
1 - An excel table which contains a column (Request (Project & Ad Hoc) where one of these 4 letters can be found, and each letter represents a number as follows
F = 70
P = 80
G = 100
E = 116
2 - So I require to transform these letters into their respective values so I can use it in further calculations.
@GilbertQ please see screen shot of the excel table below. The column in black is the one I have issues with. This column comes with a letter instead of those numbers. Let me know if you require more info
Hi there
Thanks for the screenshot.
What you could do, is go into the Power Query Editor, click on Add Conditional Column from the Add Column Ribbon.
Then you can use the conditional logic in which you can put in your requirements as shown below.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
101 | |
84 | |
79 | |
69 |
User | Count |
---|---|
120 | |
110 | |
95 | |
82 | |
77 |