Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

DAX function for Threshold

I need to verify if a particular LWR meets a threshold. I've created a threshold table for this purpose and connected it to Crystal using a performance cell. The workflow should be such that when I select a specific LWR ID in the LWR table, it filters the performance cell in Crystal based on the meaningful code, which connects both tables. Then, the filtered performance cell should further filter the threshold and display the minimum threshold in kg and EUR.

I've written a DAX function for this, but I'm not obtaining the count of the number of LWRs meeting the threshold.

Could someone kindly provide assistance with this issues? Thank you. Need Help

 

 

Threshold_Meets =
VAR ActualRevenue = SUM('LWR'[Incremental Revenue EUR])
VAR ActualVolume = SUM('LWR'[Incremental Volume])
VAR SelectedArea = SELECTEDVALUE(CRYSTAL[Performance Cell])
VAR SelectedYear = SELECTEDVALUE('Date Table'[Year])
VAR ThresholdRevenue =
    CALCULATE(
        MAX('Threshold'[Threshold-Euro]),
        'Threshold'[E-CO-PCU-A: Performance Cell L2] = SelectedArea
    )
VAR ThresholdVolume =
    CALCULATE(
        MAX('Threshold'[Threshold-KG]),
        'Threshold'[E-CO-PCU-A: Performance Cell L2] = SelectedArea
    )
RETURN
    IF(
        ActualRevenue >= ThresholdRevenue && ActualVolume >= ThresholdVolume,
        "Threshold Met",
        "Threshold Not Met"
    )
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hello Thank you for your response, I was able to figure out the way to get the count. Let me know if you are looking for solution

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

     

    Can you provide detailed sample pbix file and the results you expect.So that I can help you better. Please remove any sensitive data in advance.

     

     

     

     

    Best Regards,

    Jayleny

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello Thank you for your response, I was able to figure out the way to get the count. Let me know if you are looking for solution