Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I have two tables :
| ID | type | days |
| 1 | C | 5 |
| 2 | C | 10 |
| 3 | N | 7 |
| 4 | C | 15 |
| Product | Deadline |
| A | 10 |
| B | 15 |
I want to calculate by a measure :
Divide
count rows where type = C and days <= deadline ,
count rows where type = C
Solved! Go to Solution.
Hi @forbi ,
Please try below steps:
1. below is my test table
Table1:
Table2:
2. create a measure with below dax formula
Measure =
VAR pt =
SELECTEDVALUE ( Table2[Product] )
VAR dl =
CALCULATE ( MAX ( Table2[Deadline] ), Table2[Product] = pt )
VAR tmp1 =
FILTER ( ALL ( Table1 ), Table1[Type] = pt && Table1[Days] <= dl )
VAR tmp2 =
FILTER ( ALL ( Table1 ), Table1[Type] = pt )
RETURN
DIVIDE ( COUNTROWS ( tmp1 ), COUNTROWS ( tmp2 ) )
3. add some visual like below
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @forbi ,
Please try below steps:
1. below is my test table
Table1:
Table2:
2. create a measure with below dax formula
Measure =
VAR pt =
SELECTEDVALUE ( Table2[Product] )
VAR dl =
CALCULATE ( MAX ( Table2[Deadline] ), Table2[Product] = pt )
VAR tmp1 =
FILTER ( ALL ( Table1 ), Table1[Type] = pt && Table1[Days] <= dl )
VAR tmp2 =
FILTER ( ALL ( Table1 ), Table1[Type] = pt )
RETURN
DIVIDE ( COUNTROWS ( tmp1 ), COUNTROWS ( tmp2 ) )
3. add some visual like below
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 56 | |
| 52 | |
| 45 | |
| 16 | |
| 16 |
| User | Count |
|---|---|
| 108 | |
| 106 | |
| 39 | |
| 33 | |
| 25 |