The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Good, the title is half vague because I honestly do not know how to put it in a few words, I tell you:
I have two tables:
-DATE-->where as the name implies, are the dates, using the "Day" column as the date ratio for everything
-DATA--> I have my records
In data I have the following table:
NUMBER | ID |
Carlos | 1 |
Marten | 2 |
Monica | 3 |
Let's pretend that, if the ID=1, the hair color is "blond", ID=2 "red", in case it is neither 1 nor 2, it is "brown". So, I want the color to appear as a value in an array, column the date and the rows the name, it would be something like this:
2022-01 2022-02 2022-03 2022-04 2022-05
Carlos Rubio Rubio Rubio colorado colorado
Marta colorado coloroado coloroado coloroado coloroado
Monica chestnut chestnut chestnut chestnut chestnut chestnut
As you may have noticed, I put two words in bold, that's because in the third month of March, Carlos changed to Rubio, and it's what I can't get out of. So far, I'm trying something like:
ColorPelo =
With that, it effectively brings me the colors corresponding to each ID, in a nutshell, it brings me the table above without "colorado" in Juan.
The problem is that I can't get him to bring me "if what I see is after March 15, 2022, Carlos is chestnut."
My idea was with logical operators, example:
Test=
var startdatte=date(2022, 03, 15)
var hoy=today()
return
if(today>startdate), "yes", "no")
-->this should return me, all record after March 3 a "yes" and previous a "no", and then I could use this logic to give me like the table I put above ... but I don't have any results.
Any help would be welcome, thank you very much
Solved! Go to Solution.
It is literally not a riddle, in my original post I explained everything there was, then you asked for less, I sent a summary. I also work and try to help whenever I can in things that I know like Python and SQL, that's not why I'm going to be an about it.
Likewise, I managed to do it, I leave what I did for anyone who has the same doubt as me. I changed the names of some tables and columns so it becomes more understandable for those who read it and can replicate it wherever they look, I hope it helps:
I want to help, but I can't be bothered scrolling up and down between your message to try fathom out what help you need.
If you ard too busy or lazy to simply describe your problem in one block with example impurt and output data, then I decline to help.
There are lots of other members on this forum who describe their problems well and are rewarded with quick replied.
Don't make it a riddle. Keep it simple please. Rember we are unpaid volunteers with other full time jobs.
If you want free help then provide the infomation clearly. Thank you
Look foward to helping you when the above information is forthcoming.
It is literally not a riddle, in my original post I explained everything there was, then you asked for less, I sent a summary. I also work and try to help whenever I can in things that I know like Python and SQL, that's not why I'm going to be an about it.
Likewise, I managed to do it, I leave what I did for anyone who has the same doubt as me. I changed the names of some tables and columns so it becomes more understandable for those who read it and can replicate it wherever they look, I hope it helps:
We want to help you but your description is too vaugue.
Please write it again clearly.
Please DONT copy and paste your DAX that does not work and expect us to fathom out how it should work !
Just tell us the functonal requirements and lets us provide the DAX thank you 😀
Provide example input data as table text (not a screen print) so we can import the data to build a soution for you.
Also provide the example desired output, with a clear description of the process flow.
Take care to use the same table and field names in the input, output and description so we can understand your problem and help you.
You example has no dates in the table. So we cant slide, dice, group or aggregate it by date 🙄
You will get a quick response if you put time and effort into writing clear problem descriptions.
Vaugue descriptions waste your time and ourtime.
Look foward to helping you when the above information is forthcoming.
Sorry, I tried to put most of the information so that it is better understood, I will summarize it:
I want an event, after a certain date, to change value. Continuing with the example above, if until month 3 Carlos was "blond", from month 4 he became "colorado".
The tables used are: 'Data' (which is where these values are located) and 'Date' (the table where all the dates are). I manage to do everything except, that after that date the value changes from blond-->colored.