Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

date in database not match with date user selected.

I have three tables: TRANSACTION, TRANSACTION_GROUP_BY_CIF and CIF. I create relationship by CIF(CIF) =TRANSACTION(CIF) AND TRANSACTION(CIF) = TRANSACTION_GROUP_BY_CIF(CIF). I make relationship those three tables for apply filter to interact each other.

+What I want to do:

Find average amount divide by number of day user selected from date between slicer.

I want to ask about datediff , when I disconnect relationship it show correct result (amount of day) from my select range date slicer. But when I connect relationship table it show wrong (amount of day).

Who can advise me about this problem or any suggestion?

Thank in advanced.

 

  • Anonymous's avatar
    Anonymous
    7 years ago

    Thank you. I sovled this problem already. 

    1. Create table:

    Bin = DATATABLE( "Id", INTEGER, "Bin", STRING, "Min", INTEGER, "Max", INTEGER, { {1,"$0-300",0,300},{2,"$300-1K",300,1000},{3,"$1K-2K",1000,2000},{4,"$2K-3K",2000,3000},{5,"$3K-4K",3000,4000},{6,"$4K-5K",4000,5000},{7,"$5K +",5000,99999999}})
    2.Create Measure group by based on Bin table.
     
    Finally i solved it.Thank you for your reply.

2 Replies

  • v-piga-msft's avatar
    v-piga-msft
    Icon for Resident Rockstar rankResident Rockstar

    Hi Anonymous ,

    To understand your scenario better, please show your sample data in text-tabular format in addition to (or instead of)  screen captures. That allows people trying to help to readily copy the data and run a quick test, plus it increases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).

    Best  Regards,

    Cherry

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you. I sovled this problem already. 

      1. Create table:

      Bin = DATATABLE( "Id", INTEGER, "Bin", STRING, "Min", INTEGER, "Max", INTEGER, { {1,"$0-300",0,300},{2,"$300-1K",300,1000},{3,"$1K-2K",1000,2000},{4,"$2K-3K",2000,3000},{5,"$3K-4K",3000,4000},{6,"$4K-5K",4000,5000},{7,"$5K +",5000,99999999}})
      2.Create Measure group by based on Bin table.
       
      Finally i solved it.Thank you for your reply.