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.
Hi,
I have a table like below:
Id Name Type Date
100 Apple fruit 12/01/2020
100 Apple sweet 15/01/2020
I want to create the report where Type =fruit and one date column new_date=max(Date) where Type=sweet
Id Name Type New_Date
100 Apple fruit 15/01/2020
I tried many options but failed to to get desird result.
Thanks,
Milan
Solved! Go to Solution.
Create new table,
Hi,
Actually i gave you incomplete data. My apology.
Data looks like:
ID Name Type Date
100 apple fruit 01/01/2020
100 apple sweet 02/02/2020
200 banana fruit 03/03/2020
200 banana sweet 04/04/2020
Expected output
ID Name new_Date
100 apple 02/02/2020
200 banana 04/04/2020
filter: Type=fruit
New_date logic= Max(date) where type=sweet
I tried:
CALCULATE(MAX(Table(date),FILTER(Table,table[type]="sweet"))
but it gave me
ID Name new_Date
100 apple 04/04/2020
200 banana 04/04/2020
I think I need to put GROUPBY but exactly how and where its where i am struggling.
Thanks,
Milan
You are taking the max of the date on fruit, then why type filter.
Min of type and max of date will work as long as view/group by is fruit.
Create new table,
Thanku 2nd option worked for me.
Thanks,
Milan
New table=Summerize(filter(table,table[type]="Sweet"),table[id],Table[Name],Table[Type],"New_Date",MAx(Table[Date]))
Thanks,
Pravin
www.linkedin.com/in/pravin-p-wattamwar
If I resolve your problem Mark it as a solution and give kudos.
Hi,
Actually I don't want to create new table. Can it be done using create new column on the same table.
Appriciate your help.
Thanks,
Milan
Take Min of Type and Max of Fruit in Visual or create a new table like
new table = summarize(table,table[Id],table[Name],"_Type",Min(Type),"_date",Max(Date))
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin
Create one measure
Measure= Calculate(Max(table[Date],all(table)
Then drag id,name,type,measure in table visual and go to visual level filter and set type is fruit.
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar
If I resolve your problem Mark it as a solution and give kudos.
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |