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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

Calculate where measure does not equal to value

Hi Experts

 

The following DAX measure work fine, i have two version one for upward moving values and the other for downward moving values (data points). i would like to work out the 3rd option when No movement is selected from my slicer (so basically it does not equal to either up nor downwards)

 

Downwards Measure

 

Downwards = CALCULATE (
    IF (
        ISBLANK ( COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID]) ),
        BLANK (),
        COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID] )
    ),
   FILTER (
        ALLSELECTED ('PMS_FINANCIAL_PDS'[ROLL12_COMPLETE_PDS_IND] ),
        CALCULATE('_Measures'[p-value]<=0.05 && 'PMS_FINANCIAL_PDS'[Tau 1] < 0)
    )
) + 0

Upwards Measure

 

 

Upwards = CALCULATE (
    IF (
        ISBLANK ( COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID]) ),
        BLANK (),
        COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID] )
    ),
   FILTER (
        ALLSELECTED ('PMS_FINANCIAL_PDS'[ROLL12_COMPLETE_PDS_IND] ),
        CALCULATE('_Measures'[p-value]<=0.05 && 'PMS_FINANCIAL_PDS'[Tau 1] > 0)
    )
) + 0

the key is the '_Measures'[p-value]<=0.05 && 'PMS_FINANCIAL_PDS'[Tau 1] > 0) part which tell you direction of movement.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I would make a measure like the one below - it should filter the opposite observations than upward and downwards:

The logic: 

  • if the p-value is above 0,05 it will not be in either up or down, thus these rows are included.
  • if the Tau 1 is equal to 0 it will not be included in the up or down.

If either of the two is true then the row is included in the dataset. 

 

No change = CALCULATE (
    IF (
        ISBLANK ( COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID]) ),
        BLANK (),
        COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID] )
    ),
   FILTER (
        ALLSELECTED ('PMS_FINANCIAL_PDS'[ROLL12_COMPLETE_PDS_IND] ),
        CALCULATE('_Measures'[p-value] > 0.05 || 'PMS_FINANCIAL_PDS'[Tau 1] = 0)
    )
) + 0

If this works then please mark it as the solution and else please provide some more information about your issue, i.e. a small sample of the data.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

I would make a measure like the one below - it should filter the opposite observations than upward and downwards:

The logic: 

  • if the p-value is above 0,05 it will not be in either up or down, thus these rows are included.
  • if the Tau 1 is equal to 0 it will not be included in the up or down.

If either of the two is true then the row is included in the dataset. 

 

No change = CALCULATE (
    IF (
        ISBLANK ( COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID]) ),
        BLANK (),
        COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID] )
    ),
   FILTER (
        ALLSELECTED ('PMS_FINANCIAL_PDS'[ROLL12_COMPLETE_PDS_IND] ),
        CALCULATE('_Measures'[p-value] > 0.05 || 'PMS_FINANCIAL_PDS'[Tau 1] = 0)
    )
) + 0

If this works then please mark it as the solution and else please provide some more information about your issue, i.e. a small sample of the data.

Anonymous
Not applicable

All Experts

 

Many thanks for the excellent feedback.

Mariusz
Community Champion
Community Champion

Hi @Anonymous 

Try.

Downwards = CALCULATE (
    IF (
        ISBLANK ( COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID]) ),
        BLANK (),
        COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID] )
    ),
   FILTER (
        ALLSELECTED ('PMS_FINANCIAL_PDS'[ROLL12_COMPLETE_PDS_IND] ),
        CALCULATE('_Measures'[p-value]<=0.05 && 'PMS_FINANCIAL_PDS'[Tau 1] = 0)
    )
) + 0
Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski


Anonymous
Not applicable

Apologies for asking can anyone shed some light on

https://community.powerbi.com/t5/Desktop/Relationship-issue-with-Measure/m-p/786447#M378770

 

its been driving me mad. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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