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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

First Date where the % is less than 90

Hi,

I have below report, I want to show the first date where the % is less than 90% per State per RC.

 

2022-03-08_14-42-12.png

 

Can anyone help?

 

 

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Picture1.png

 

First date less than 90% =
VAR newtable =
    ADDCOLUMNS (
        SUMMARIZE ( Data, Data[State], Data[RC], Data[Date] ),
        "@ratio", CALCULATE ( DIVIDE ( SUM ( Data[Count] ), SUM ( Data[Slots] ) ) )
    )
VAR filtertable =
    FILTER ( newtable, [@ratio] < 0.9 )
RETURN
    IF ( HASONEVALUE ( Data[State] ), MINX ( filtertable, Data[Date] ) )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

Anonymous
Not applicable

This is my DAX:

First date less than 90% =
VAR newtable =
ADDCOLUMNS (
SUMMARIZE ( Count, Location[State], Location[RC], Data[Date] ),
"@ratio", CALCULATE ( DIVIDE ( SUM ( Count[Count] ), SUM ( Slots[Slots] ) ) )
)
VAR filtertable =
FILTER ( newtable, [@ratio] < 0.9 )
RETURN
IF ( HASONEVALUE ( Location[State] ), MINX ( filtertable, Data[Date] ) )

 

and I get below, it correctly filter <90, but not the min date per RC:

 

 2022-03-09_10-43-12.png

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

Hi @Jihwan_Kim ,

 

It is working now, thanks for your help.

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Picture1.png

 

First date less than 90% =
VAR newtable =
    ADDCOLUMNS (
        SUMMARIZE ( Data, Data[State], Data[RC], Data[Date] ),
        "@ratio", CALCULATE ( DIVIDE ( SUM ( Data[Count] ), SUM ( Data[Slots] ) ) )
    )
VAR filtertable =
    FILTER ( newtable, [@ratio] < 0.9 )
RETURN
    IF ( HASONEVALUE ( Data[State] ), MINX ( filtertable, Data[Date] ) )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hi @Jihwan_Kim ,

 

Just on last thing, Can you please help with how to get the Count and slots figure for the first date, at the moment I get the sum.

Thanks.

Hi,

Please check the attached file.

Thank you.

 

Count on First date less than 90% = 
VAR newtable =
    ADDCOLUMNS (
        SUMMARIZE ( Data, Data[State], Data[RC], Data[Date], Data[Slots], Data[Count] ),
        "@ratio", CALCULATE ( DIVIDE ( SUM ( Data[Count] ), SUM ( Data[Slots] ) ) )
    )
VAR filtertable =
    FILTER ( newtable, [@ratio] < 0.9 )
VAR mindate =
    MINX ( filtertable, Data[Date] )
VAR countfigure =
    SUMX ( FILTER ( newtable, Data[Date] = mindate ), Data[Count] )
RETURN
    IF ( HASONEVALUE ( Data[State] ), countfigure )

 

Slots on First date less than 90% = 
VAR newtable =
    ADDCOLUMNS (
        SUMMARIZE ( Data, Data[State], Data[RC], Data[Date], Data[Slots], Data[Count] ),
        "@ratio", CALCULATE ( DIVIDE ( SUM ( Data[Count] ), SUM ( Data[Slots] ) ) )
    )
VAR filtertable =
    FILTER ( newtable, [@ratio] < 0.9 )
VAR mindate =
    MINX ( filtertable, Data[Date] )
VAR slotsfigure =
    SUMX ( FILTER ( newtable, Data[Date] = mindate ), Data[Slots] )
RETURN
    IF ( HASONEVALUE ( Data[State] ), slotsfigure )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hi @Jihwan_Kim ,

Thanks for your quick response.

I get error because the date is in Date table, State is in the Location table, they are not in the same table.

 

 

Anonymous
Not applicable

Also the Count and Slots are in another different tables.

HI,

Thank you for your feedback.

Sorry that I cannot imagine how your data model looks like.

I think, sharing your sample pbix file will help. 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

I can't share the pbix because I have tabular model.

Attached is a simple draw of the model.PXL_20220308_051439622.jpg

Anonymous
Not applicable

This is my DAX:

First date less than 90% =
VAR newtable =
ADDCOLUMNS (
SUMMARIZE ( Count, Location[State], Location[RC], Data[Date] ),
"@ratio", CALCULATE ( DIVIDE ( SUM ( Count[Count] ), SUM ( Slots[Slots] ) ) )
)
VAR filtertable =
FILTER ( newtable, [@ratio] < 0.9 )
RETURN
IF ( HASONEVALUE ( Location[State] ), MINX ( filtertable, Data[Date] ) )

 

and I get below, it correctly filter <90, but not the min date per RC:

 

 2022-03-09_10-43-12.png

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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