Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Heonsang
Frequent Visitor

Find out first date workable in slicer

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

 

 

 

1 ACCEPTED SOLUTION
LivioLanzo
Solution Sage
Solution Sage

 

Hi @Heonsang

 

I do not if i understood it correctly but that is what I did:

 

created this model

 

 

 

Capture.PNG

 

 

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()
    )
)

Capture.PNG

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

View solution in original post

2 REPLIES 2
v-jiascu-msft
Employee
Employee

Hi @Heonsang,

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
LivioLanzo
Solution Sage
Solution Sage

 

Hi @Heonsang

 

I do not if i understood it correctly but that is what I did:

 

created this model

 

 

 

Capture.PNG

 

 

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()
    )
)

Capture.PNG

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.