Forum Discussion

Edgar_massa's avatar
Edgar_massa
Icon for Helper II rankHelper II
3 years ago
Solved

Use measurement result to create another

good night dear

I have a table where I make a difference of simple days, using the following measure:

 

But I'm trying to use the day difference result to create a deadline status measure as follows:

 

But it gives some error and the table is as follows:

 

What am I doing wrong?

 

 

 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Edgar_massa ,

    If I understand correctly, it seems that the measure [Status] can't return the correct result base on the measure [Deadline Days]. Am I right? Please create a measure as below base on the measure [Prazo em Dias] as below and update the formula of measure [Status] as below. Later please check if it can return the correct result...

    Measure =
    SUMX (
        GROUPBY (
            fac_TicketsHistorico,
            fac_TicketsHistorico[dt_envio_financeiro],
            fac_TicketsHistorico[dt_prev_pagamento],
            fac_TicketsHistorico[Codigo]
        ),
        [Prazo em Dias]
    )
    Status = IF([Measure]<=5,"NOK","OK")

    If the above one can't help you get the expected result, please provide some raw data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

    How to provide sample data in the Power BI Forum

     

    And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community

    Best Regards

6 Replies

  • Edgar_massa columns in your screenshot are in Spanish and I cannot correlate those with the reply you have provided. I hope someone with Spanish knowledge can help you. Details of this post is making everything complicated for no reason. good luck!

    • Edgar_massa's avatar
      Edgar_massa
      Icon for Helper II rankHelper II

      The second print of the table is when I use the measure of days to create another measure, where everything is returning wrong, I don't understand what is happening, I can use the period of days to create a text where if it is less than or equal to 5, return the text "Out of time" if not "Up to date" ?

  • Edgar_massa I'm still not clear, If you remove the status measure from the 2nd screen shot then you see the days in prazo em dias measure.

     

    Just confirming, are you adding measures or calculated columns?

    • Edgar_massa's avatar
      Edgar_massa
      Icon for Helper II rankHelper II

      parry2k 

       

      I want to create a measure called Status, where based on the result of the "Deadline Days" measure, if it is less than or equal to 5, it will be out of date, if it will not be up to date, the only measure in this table is the "Deadline Days", the rest are all table columns, I just need to create another measure that brings the description up to date or not based on the deadline in days, but when I add the measure that has the IF, the table is wrong, according to the second print

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Edgar_massa ,

    If I understand correctly, it seems that the measure [Status] can't return the correct result base on the measure [Deadline Days]. Am I right? Please create a measure as below base on the measure [Prazo em Dias] as below and update the formula of measure [Status] as below. Later please check if it can return the correct result...

    Measure =
    SUMX (
        GROUPBY (
            fac_TicketsHistorico,
            fac_TicketsHistorico[dt_envio_financeiro],
            fac_TicketsHistorico[dt_prev_pagamento],
            fac_TicketsHistorico[Codigo]
        ),
        [Prazo em Dias]
    )
    Status = IF([Measure]<=5,"NOK","OK")

    If the above one can't help you get the expected result, please provide some raw data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

    How to provide sample data in the Power BI Forum

     

    And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community

    Best Regards