Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi Team, could you please help on below senorio,
If TtValue<CummValue then show that partcular PValue else show MAX PValue
Thank you,
Veera
Solved! Go to Solution.
hi @VEERA3141
not sure if i fully get you, try to add a calculated column like:
Expected2 =
VAR MaxPValue =
MAXX(
FILTER(
data,
data[Category]= EARLIER(data[Category])
),
data[PValue]
)
RETURN
IF([TtValue]<[CummValue], [Pvalue], MaxPValue)
it worked like:
hi @VEERA3141
not sure if i fully get you, try to add a calculated column like:
Expected2 =
VAR MaxPValue =
MAXX(
FILTER(
data,
data[Category]= EARLIER(data[Category])
),
data[PValue]
)
RETURN
IF([TtValue]<[CummValue], [Pvalue], MaxPValue)
it worked like:
This is fine but how to get min values at catogory level by reusing the Expected 2 column @FreemanZ
Got it calculate(min(expected 2), allecpect(table, cat))
Thank you
Hi @FreemanZ thanks for respond,
I am expecting the "Expected" Column in the image based on the condition, please find the below image for more details.
Expected = If TtValue<CummValue then show that partcular catogory PValue else show partcular catogory MAX PValue
Hi @123abc thanks for respond,
I am expecting the "Expected" Column in the image based on the condition, please find the below image for more details.
Expected = If TtValue<CummValue then show that partcular catogory PValue else show partcular catogory MAX PValue
hi @VEERA3141
the proposed solution is based on your expectataion:
"Expected = If TtValue<CummValue then show that partcular catogory PValue else show partcular catogory MAX PValue"
however, it comes with different result.
Could you also check the consistency of your description with your table?
For instance, for the row A, P1, TtValue > CummValue, so Max Pvalue of 9 should be returned, right?
It looks like you're trying to create a measure in Power BI that calculates a specific value based on a condition. In your scenario, you want to compare the value of TtValue to CummValue and based on that condition, display either the PValue or the maximum PValue.
You can achieve this using a DAX (Data Analysis Expressions) measure in Power BI. Here's a step-by-step guide on how to create such a measure:
Open your Power BI report.
Go to the "Model" view by clicking on the "Model" icon in the left-hand panel.
In the "Fields" pane, right-click on your table and select "New Measure." You can name your measure something like "Conditional PValue."
In the formula bar, you can use the following DAX formula:
Conditional PValue =
IF([TtValue] < [CummValue], [PValue], CALCULATE(MAX([PValue]), ALL('YourTableName')))
Replace 'YourTableName' with the name of the table where your data is located. This formula uses the IF function to check whether TtValue is less than CummValue. If it is, it returns PValue. Otherwise, it calculates the maximum PValue for all rows in the table.
Now you can use the "Conditional PValue" measure in your report visuals. When you place this measure in a visual, it will display the desired result based on your conditions.
Remember to replace 'YourTableName' with the actual name of the table in your Power BI data model. Make sure your column and table names match the names in your data source.
If you have further questions or encounter any issues, please provide more specific details about your data structure and I'd be happy to assist further.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
Hi @123abc thanks for respond,
I am expecting the "Expected" Column in the image based on the condition, please find the below image for more details.
Expected = If TtValue<CummValue then show that partcular catogory PValue else show partcular catogory MAX PValue
User | Count |
---|---|
50 | |
24 | |
18 | |
18 | |
14 |
User | Count |
---|---|
91 | |
86 | |
39 | |
25 | |
21 |