Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello. I am having problems, I have the following table:
If ID=1, the user has a house. If ID=2, you have a car. Opposite case, has a plane. The "DATA" table can be filtered with dates thanks to a table called DATE.
Fred, after March 15, 2022, sold his house and bought a car, consequently, he would belong to ID=2. The result I want is the following:
I couldn't get those two values to change from house-->car
Just in case: this is what i was trying:
Measure =
var SelectType=value(selectedvalue('DATE'[NAME])
var is_house=SelectType=1
var is_car=SelectType=2
var is_plane=not(is_house || is_car)
//With that, I manage to select the 3 types of data that I need
var SelectNames=selectedvalue('DATA'[Name])
var StartDate=DATE(2022, 03, 15)
var SelectDay=selectedvalue('DATE'[Day])
//With this, the idea is to use it later to say "if the date is greater than StartDate, I want to [specify what I want] result"
return
if(is_house, "House",
if(is_car, if(Selectday>StartDate, if(SelectNames="Fred", "Car",
//IF it is car, then IF the date is after StartDate AND IF the name is Fred, then it is changed to "Car"
if(is_car, "Car",
if(is_plane, "Plane"
))))))
Until now, everything I found on the Internet was related to what they wanted to add between dates, I did not find something similar to my problem.
Any idea is welcome 😔
Solved! Go to Solution.
Hi @cris1196 ,
Is this the only table you have for original data? All sales purchase records need to be manually go through the parameters in Dax? Creating measures like this can be very difficult to maintain in code later.
A better solution would be to organize all buy and sell records into a fact table and create a relationship with the date column of the calendar table, so that the problem becomes much easier.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Hi @cris1196 ,
Is this the only table you have for original data? All sales purchase records need to be manually go through the parameters in Dax? Creating measures like this can be very difficult to maintain in code later.
A better solution would be to organize all buy and sell records into a fact table and create a relationship with the date column of the calendar table, so that the problem becomes much easier.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
"A better solution would be to organize all buy and sell records into a fact table and create a relationship with the date column of the calendar table, so that the problem becomes much easier."
Yes, I did that. Much more comfortable. Thank you!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
45 | |
28 | |
21 | |
11 | |
8 |
User | Count |
---|---|
77 | |
50 | |
46 | |
16 | |
12 |