Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Filter depending on values

Hi guys:

I have accounting periods with date/time format. When the period is closed the format is "dd/mm/yyyy hh:ss" with the last day, for example "31/10/2020 12:00" and when we need to add some info after this, we add a row with the same date, but 1 am, continuing with the same example "31/10/2020 01:00".

So, what I need in Power BI is put a filter that gives me 2 options "A" and "B",
A: allows me to have all the periods with the 12:00 and excluiding the ones with 1:00.

B: use the period when it have the 01:00 excluding the periods with 12:00, but when the period does not have 01:00 let the period with 12:00.

Something like this:

TableFilter AFilter B
31/01/2020 12:0031/01/2020 12:0031/01/2020 01:00
31/01/2020 01:0028/02/2020 12:0028/02/2020 12:00
28/02/2020 12:0031/03/2020 12:0031/03/2020 12:00
31/03/2020 12:0030/04/2020 12:0030/04/2020 01:00
30/04/2020 12:00  
30/04/2020 01:00  

 

Regards 

  • Hi Anonymous 

     

    Is this what you want? Please download the PBIX file for details. Let me know if you have any questions.

     

    Best Regards,
    Community Support Team _ Jing Zhang
    If this post helps, please consider Accept it as the solution to help other members find it.

5 Replies

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

    Hi Anonymous 

     

    Is this what you want? Please download the PBIX file for details. Let me know if you have any questions.

     

    Best Regards,
    Community Support Team _ Jing Zhang
    If this post helps, please consider Accept it as the solution to help other members find it.

  • Anonymous , Not ver clear but column like

    if([datetime].time = time(0,0,0) , [datetime], blank())

     

    or

     

    if([datetime].time = time(1,0,0) , [datetime], blank())

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi, thank you for your help. I am so sorry that I did not explain correctly.

      I think that I need a measure, because I need the filter result on this table (let me paste it again, cause I see that the columns are so close):

       

      My dates will be every final date of each month, plus the "12:00". In some cases I will have this date + "12:00" and, also, the same final date of the month, plus 1:00.

      I need in this filter option A and option B. When A is selected I should have all the dates rows with the "12:00", but when I have the B filter, I should have only all the dates with "12:00" BUT in the cases when I have the same 2 dates (one with "12:00" and the other with "1:00"), excludes the one with "12:00", and shows the date with "1:00" and the dates that just have "12:00" show them to. 

      That is why, in my table example, the A have just dates with "12:00" and in B I have a mix of "12:00" and "1:00".

       

      I hope I have explained myself better

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

    Hi Anonymous ,

     

    Has this problem been solved? If so, kindly Accept the appropriate reply as the solution or post your own solution. People having similar questions will find it quickly. If not solved, share more info about how it is going now. Thanks.


    Regards,
    Jing

    • Anonymous's avatar
      Anonymous
      Not applicable

      the answer was great, I´ve already accepted as a solution.

      Regards