Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
VEERA3141
New Member

Need help on period measure

Hi Team, could you please help on below senorio,

 

If TtValue<CummValue then show that partcular PValue else show MAX PValue

 

VEERA3141_0-1698031496350.png

@Greg_Deckler , @OwenAuger ,

Thank you,

Veera

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

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:

FreemanZ_0-1698043491856.png

View solution in original post

8 REPLIES 8
FreemanZ
Super User
Super User

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:

FreemanZ_0-1698043491856.png

This is fine but how to get min values at catogory level by reusing the Expected 2 column @FreemanZ  

hi @VEERA3141 , how would you use the min value?

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

 

VEERA3141_0-1698044654776.png

 

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?

123abc
Community Champion
Community Champion

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:

  1. Open your Power BI report.

  2. Go to the "Model" view by clicking on the "Model" icon in the left-hand panel.

  3. In the "Fields" pane, right-click on your table and select "New Measure." You can name your measure something like "Conditional PValue."

  4. 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.

  1. Press Enter to create the measure.

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.

 

ExpectedIf TtValue<CummValue then show that partcular catogory PValue else show partcular catogory MAX PValue

 

VEERA3141_0-1698044098075.png

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors