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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I need to create a certain measure that calculates:
| Date | Quantity |
| 2025/01/01 | 69 |
| 2025/01/02 | 69 |
| 2025/01/03 | 69 |
| 2025/01/01 | 120 |
| 2025/01/02 | 120 |
| 2025/01/01 | 200 |
| 2025/01/01 | 200 |
| 2025/01/02 | 200 |
I need a measure that calculates a kind of sumproduct, in which you need to multiply the quantity by the number of days it was implemented, then add these results together and finally, divide everything by the total number of days. Basically, make the following numerical expression:
((69 * 3) + (120 * 2) + (200 * 2))/3
In this previous example, the result on a card should be approximately 282.3
Solved! Go to Solution.
Hi, would this be the result you were looking?
Measure =
VAR _SummaryTable = SUMMARIZECOLUMNS( 'Sample'[ Quantity], "DaysCount", DISTINCTCOUNT('Sample'[Date]) )
VAR _Numerator =
SUMX(
_SummaryTable,
[ Quantity] * [DaysCount]
)
VAR _Denominator =
DISTINCTCOUNT('Sample'[Date])
VAR _Result=
DIVIDE(_Numerator, _Denominator)
RETURN
_Result
Hi, would this be the result you were looking?
Measure =
VAR _SummaryTable = SUMMARIZECOLUMNS( 'Sample'[ Quantity], "DaysCount", DISTINCTCOUNT('Sample'[Date]) )
VAR _Numerator =
SUMX(
_SummaryTable,
[ Quantity] * [DaysCount]
)
VAR _Denominator =
DISTINCTCOUNT('Sample'[Date])
VAR _Result=
DIVIDE(_Numerator, _Denominator)
RETURN
_Result
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 134 | |
| 96 | |
| 78 | |
| 67 | |
| 65 |