Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi Everyone,
I have two number cards that each has the average value for a specific column from different tables.
my goal is to get the average value for these two cards.
currently, I'm trying to use a new quick measure with a DAX formula but I'm not getting the correct results as I'm sure my calculation is not correct.
This is the current formula
the first card is getting the average of this column
Solved! Go to Solution.
Removing the All() worked, Thank you so much for your help 🙂
This is the final code
Measure =
VAR a =
CALCULATE (
SUM ( LeadTimeNew[Lead Time by Release YAML (Days)] )
)
VAR cra =
COUNTROWS ( LeadTimeNew )
VAR b =
CALCULATE (
SUM ( LeadTime[Lead Time by Release (Days)] )
)
VAR crb =
COUNTROWS ( LeadTime )
VAR d = a + b
VAR e = cra + crb
RETURN
DIVIDE (
d,
e
)
Hi @malaw ,
Try this measure
Measure =
VAR a =
CALCULATE (
SUM ( LeadTimeNew[Lead Time by Release YAML (Days)] ),
ALL ( LeadTimeNew )
)
VAR cra =
COUNTROWS ( LeadTimeNew )
VAR b =
CALCULATE (
SUM ( LeadTime[Lead Time by Release (Days)] ),
ALL ( LeadTime )
)
VAR crb =
COUNTROWS ( LeadTime )
VAR d = a + b
VAR e = cra + crb
RETURN
DIVIDE (
d,
e
)
or
Measure =
VAR a =
CALCULATE (
SUM ( LeadTimeNew[Lead Time by Release YAML (Days)] ),
ALL ( LeadTimeNew )
)
VAR b =
CALCULATE (
SUM ( LeadTime[Lead Time by Release (Days)] ),
ALL ( LeadTime )
)
VAR d = a + b
RETURN
DIVIDE (
d,
2
)
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
Thanks for your prompt response 🙂
These are the two average values I have for Lead Time by Release (Days) = 18
and Lead Time by Release YAML (Days) = 5.59
there are some filters applied for each card to select a specific project to calculate the lead time for each project (would this affect the calculation that we need to do?)
The goal is to get a combined average value for both
when I used the first calculation you provided I got this value: 6.06 K
and when I used the second calculation I got this value: 35.50M
The formulas make sense but I'm still not getting the correct results 😞
Please let me know your thoughts
Hi @malaw ,
Since you have filters applied, it is affecting the averages.
Try removing ALL() from the formula and see.
Als can you share a screen shot of your cards, filters and measures.
Regards,
Harsh Nathani
Removing the All() worked, Thank you so much for your help 🙂
This is the final code
Measure =
VAR a =
CALCULATE (
SUM ( LeadTimeNew[Lead Time by Release YAML (Days)] )
)
VAR cra =
COUNTROWS ( LeadTimeNew )
VAR b =
CALCULATE (
SUM ( LeadTime[Lead Time by Release (Days)] )
)
VAR crb =
COUNTROWS ( LeadTime )
VAR d = a + b
VAR e = cra + crb
RETURN
DIVIDE (
d,
e
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
21 | |
15 | |
15 | |
11 | |
7 |
User | Count |
---|---|
25 | |
24 | |
12 | |
12 | |
11 |