This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi guys,
I'm trying to create Measure to count other Measure based on conditions below,
Hi ,
Based on the description, try to create a table that includes the dates you need. Try using the following DAX formula.
Qualified Flag Count =
VAR _ActiveFlag = IF([ActiveFlag] > 0, 1, 0)
VAR _SalesInv = IF([Cumulative Sales] + [Inventory] > 0, 1, 0)
VAR _QualifiedFlag = IF(_ActiveFlag + _SalesInv = 2, 1, 0)
RETURN
SUMX(
CALENDAR(MIN('Table'[Date]), MAX('Table'[Date])),
_QualifiedFlag
)
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
it still shows blank, I guess it's because I do not have data rows in source data table for those in June and July month...
Hi @FarhanJeelani ,
Thanks for the advices! I just checked and realized that in June & July, the rows of data does not exist in the source table. Is there any way to fix this?
I used to create table to combine all combination of SKU and month and other data but then it collapsed because the data is too big...
Make since to me also
Hi @cj_oat ,
The issue you’re facing is due to how SUMX works within the row context. The problem arises because _QualifiedFlag is being evaluated in the wrong context when you use SUMX. To resolve this and get the correct results for both individual cells and the totals, you need to make sure the measure respects the context correctly.
Here’s the corrected measure:
Qualified Flag Count =
SUMX(
'Table',
VAR _ActiveFlag = IF([ActiveFlag] > 0, 1, BLANK())
VAR _SalesInv = IF([Cumulative Sales] + [Inventory] > 0, 1, BLANK())
VAR _QualifiedFlag = IF(_ActiveFlag + _SalesInv = 2, 1, BLANK())
RETURN _QualifiedFlag
)Moving Calculations Inside SUMX:
Ensuring Proper Context:
Check Table Rows:
Let me know if this works!
Please mark this as solution if it helps. Appreciate Kudos.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 30 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 60 | |
| 48 | |
| 29 | |
| 23 | |
| 23 |