Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi,
In the attached simplified example below, I'd like to create a measure which will always sum the first three row values in the table.
The current measure I've written is a calculate measure but uses the expression as the Company 1 values. This means it's specific to Company 1 so for Company 2 I'd have to duplicate it.
The new measure would ideally not require a specific company to be used in the measure expression to calculate the first three rows.
https://1drv.ms/u/s!Ajcv_9xvRfBd5ztQeRbRnFa5h1Am?e=mO0Ncf
Hope that makes sense.
Thanks for reading.
Solved! Go to Solution.
Hi, @smitpau
Based on your description, you may create a measure as below. The pbix file is attached in the end.
Sum First 3 =
SUMX(
SUMMARIZE(
'Table',
'Table'[Company],
"Result",
SWITCH(
[Company],
"Company1",
CALCULATE(
SUM('Company 1'[Value]),
FILTER(
ALL('Company 1'),
VALUE([SI])<4
)
),
"Company2",
CALCULATE(
SUM('Company 2'[Value]),
FILTER(
ALL('Company 2'),
VALUE([SI])<4
)
)
)
),
[Result]
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @smitpau
Based on your description, you may create a measure as below. The pbix file is attached in the end.
Sum First 3 =
SUMX(
SUMMARIZE(
'Table',
'Table'[Company],
"Result",
SWITCH(
[Company],
"Company1",
CALCULATE(
SUM('Company 1'[Value]),
FILTER(
ALL('Company 1'),
VALUE([SI])<4
)
),
"Company2",
CALCULATE(
SUM('Company 2'[Value]),
FILTER(
ALL('Company 2'),
VALUE([SI])<4
)
)
)
),
[Result]
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
For each company sum up the values where [SI] is between 1 and 3.
Why do you have separate tables per company? You shoud combine the tables into one, either via DAX UNION() or better in Power Query.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 46 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 69 | |
| 32 | |
| 27 | |
| 26 |