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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Define output with condition when same row name with different output

Hi All , 

 

Can pls guide me how do i get the expected output as below ? 

- i have same value under Product column with different status ,if there is "Late" in status , then we will categories as "Late" 

- Ontime% will be based on overall status.. 

 

SuMati_1-1625735387686.png

 

1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

8 REPLIES 8
amitchandak
Super User
Super User

@Anonymous , Try new column and measure

 

new column
overall Status= countx(filter(Table, [product] = earlier([product] ) && [Status] = "Late"),[product])

New meausre  
divide(calculate(distinctcount(Table[Product]), [overall Status] = "Late"), calculate(distinctcount(Table[Product]) ,all(Table)))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak , 

 

Thanks and appreciate very much on your fast response. 

- I hv tried but it doesnt work as expected. 

 

Overall status column 

- Can help to show the overall status in text format  ? ( Shown in expected output in first post) 

( if there is a "Late" in status column for the product , then will take the worst case as "late", else will be "On time"  ) 

- the overall status dax function you shared is ignoring "On time" status  as below 

SuMati_0-1625794433095.png

- Measure logic is not working. 

 

 

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

HI @Ashish_Mathur , 

Thank you for the file., it is working ! 

 

Could you please help me to interpret this measure that you created  ? 

Not too sure how this only consider worst case "late" when both "On time" and "late" condition exists. 

 

Measure = if(ISNUMBER(CALCULATE([Countrow_],FILTER(VALUES(Data[Product]),[Countrow_]=[On time count]))),"On Time","Late")
 

You are welcome.

If the number of rows of that product equal the number of on time entries of that product, then show On time, else show late.

If my previous reply helped, please mark that as Answer. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur  , 

Got it , thank you very much for the explanation. 

 

I tried to combine ur dax solution with my other calculation( daydiff_item) ..result was odd, can please help shed some light ? 

 

Category_Product =

Var Daycheck = If(ISBLANK('Table1'[DayDiff_Item]),Blank() ,
if('Table1'[DayDiff_Item] <= 1 , "On Time" ,
If('Table1'[DayDiff_Item] >= 2 , " Late " ,
Check data
)))

Var Ontime2 = CALCULATE(countallrow, FILTER('Table1', Daycheck = "On Time"))
Return

if(ISBLANK('Table1'[DayDiff_Item]),Blank(),
If(ISNUMBER
(CALCULATE([CountROW_all_row],FILTER(VALUES('Table1'[Product ]),
CountROW_all_row= Ontime2))),"On Time","Late"))

 

 

the output  : All status in "Late" 

 

 

Hi,

I am not sure what you are trying to accomplish there.  If you still need my help, share some data and explain the question in simple English rather than pasing your formula.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Ashish_Mathur  , 

 

So sorry for that ! 

I found my mistake after some online research.. 

 

Thanks again for your help ,  learnt something new 🙂 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.