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'm trying to calculate premier and repeat value from the data table. Last time I could create Premier data by adding the measure CALCULATE(MIN(Data[Transmitted Date]), VALUES(Data[Program])) but this isn't useless at this scenario. If I add Transmitted Date in Result Table then this measure doesn't work.
I have created the source and result I expect.
- Data Table
Program | Duration | Transmitted Date (d/m/y)
Avengers | 0:22:00 | 5/2/2018
Avengers | 0:22:00 | 2/3/2018
Avengers | 0:22:00 | 25/3/2018
Avengers | 0:22:00 | 26/3/2018
Avengers | 0:22:00 | 5/4/2018
Black Panther | 0:25:00 | 2/3/2018
Black Panther | 0:25:00 | 6/3/2018
Captain Marvel | 0:32:00 |7/2/2018
Captain Marvel | 0:32:00 |25/2/2018
- Report
Slicer : Tramsmitted Date is between 1/3/2018 and 31/3/2019
Result table
Program | Duration | Transmitted Date (d/m/y) | Premier or Repeat
Avengers | 0:22:00 | 2/3/2018 | Premier
Avengers | 0:22:00 | 25/3/2018 | Repeat
Avengers | 0:22:00 | 26/3/2018 | Repeat
Black Panther | 0:25:00 | 2/3/2018 | Premier
Black Panther | 0:25:00 | 6/3/2018 | Repeat
Premier duration = 0:22:00 + 0:25:00
Solved! Go to Solution.
Hi @Heonsang
I do not if i understood it correctly but that is what I did:
created this model
and added this measure:
Measure = IF( HASONEVALUE( Programs[Program] ), IF( COUNTROWS( Transmissions ) > 0, VAR MinDte = CALCULATE( MIN( Transmissions[TransmittedDate(d/m/y)] ), ALLSELECTED( 'Calendar' ) ) RETURN IF( MinDte = MIN( 'Calendar'[Date] ), "Premier", "Repeat" ), BLANK() ) )
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Hi @Heonsang,
Could you please mark the proper answers as solutions?
Best Regards,
Dale
Hi @Heonsang
I do not if i understood it correctly but that is what I did:
created this model
and added this measure:
Measure = IF( HASONEVALUE( Programs[Program] ), IF( COUNTROWS( Transmissions ) > 0, VAR MinDte = CALCULATE( MIN( Transmissions[TransmittedDate(d/m/y)] ), ALLSELECTED( 'Calendar' ) ) RETURN IF( MinDte = MIN( 'Calendar'[Date] ), "Premier", "Repeat" ), BLANK() ) )
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
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 |
---|---|
110 | |
94 | |
80 | |
67 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |