Forum Discussion

4 Replies

  • Hi Bertje123456,

    As I am not confortable in Power Query 😞 
    Please find the DAX version to solve the above problem.
    1. Create a new table which can help
    ExceedanceType = DATATABLE(
    "ExceedType", STRING,
    {
    { "3 exceedances within limit" },
    { "3 exceedances beyond limit" }
    }
    )

    2.Create below measures:
    ExceedancesWithinLimit =
    CALCULATE(
    DISTINCTCOUNT('VW_AANSLUITING_VERBRUIK_ELK'[EAN code]),
    FILTER(
    'VW_AANSLUITING_VERBRUIK_ELK',
    'VW_AANSLUITING_VERBRUIK_ELK'[Number of months] = 3
    && 'VW_AANSLUITING_VERBRUIK_ELK'[kW transport capacity exceedance] > 0
    ),
    RELATED('VW_AANSLUITING_VERBRUIK_ELK'[kW transport capacity exceedance]) <= RELATED('VW_D_Transportbeperking'[Limit])
    )

    ExceedancesBeyondLimit =
    CALCULATE(
    DISTINCTCOUNT('VW_AANSLUITING_VERBRUIK_ELK'[EAN code]),
    FILTER(
    'VW_AANSLUITING_VERBRUIK_ELK',
    'VW_AANSLUITING_VERBRUIK_ELK'[Number of months] = 3
    && 'VW_AANSLUITING_VERBRUIK_ELK'[kW transport capacity exceedance] > 0
    ),
    RELATED('VW_AANSLUITING_VERBRUIK_ELK'[kW transport capacity exceedance]) > RELATED('VW_D_Transportbeperking'[Limit])
    )

    3. Create a unified measure:
    ExceedanceCount =
    SWITCH(
    SELECTEDVALUE('ExceedanceType'[ExceedType]),
    "3 exceedances within limit", [ExceedancesWithinLimit],
    "3 exceedances beyond limit", [ExceedancesBeyondLimit],
    BLANK()
    )
    4.Build your matrix visual

     

    Please let me know if you have further questions.

    If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks! 

     

    Best Regards, 

    Maruthi 

    LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/ 

    X            -  Maruthi Siva Prasad - (@MaruthiSP) / X

  • v-echaithra's avatar
    v-echaithra
    Community Support

    Hi Bertje123456 ,

    May I ask if you have gotten this issue resolved?

     

    If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.

     

    Regards,
    Chaithra.

  • v-echaithra's avatar
    v-echaithra
    Community Support

    Hi Bertje123456 ,

    We would like to follow up to see if the solution provided by the user resolved your issue. Please let us know if you need any further assistance.
    If the provided response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

     

    Regards,
    Chaithra.

  • v-echaithra's avatar
    v-echaithra
    Community Support

    Hi Bertje123456 ,

    Thank you for reaching out to Microsoft Community.
    If the issue is resolved by yourself, i request you to please accept your own post as the solution, this will help other community members who might face a similar issue. If not raise a new thread if there are any issues or concerns

     

    Thanks and Regards.