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
Thanks in Advance .
The above one is my source table .I want to get the output as :-
From the Min date to the max date for the specific Part Id ,i want to get the cumilative total measure(not calculated column).
Also i want to find by using that measure ,when Part_Id has crossed 5 rupees .Like below :-
Please Help me .
Solved! Go to Solution.
@abhijeetbehuria Try:
Cumulative Total Measure =
VAR __PartID = MAX('Table'[Part_Id])
VAR __Date = MAX('Table'[Month Date])
VAR __Table = FILTER(ALLSELECTED('Table'),[Part ID] = __PartID && [Month Date] <= __Date)
VAR __Result = SUMX(__Table, [Amount])
RETURN
__Result
and
5 Rupee Measure =
VAR __PartID = MAX('Table'[Part_Id])
VAR __Date = MAX('Table'[Month Date])
VAR __Table = FILTER(ALLSELECTED('Table'),[Part ID] = __PartID && [Month Date] <= __Date)
VAR __WhileLoop =
ADDCOLUMNS(
__Table,
"__Cumulative", SUMX(FILTER(__Table, [Month Date] <= EARLIER([Month Date])),[Amount])
VAR __Result = MINX(FILTER(__WhileLoop, __Cumulative >= 5), [Month Date])
RETURN
__Result
@abhijeetbehuria Sorry, missed a )
5 Rupee Measure =
VAR __PartID = MAX('Table'[Part_Id])
VAR __Date = MAX('Table'[Month Date])
VAR __Table = FILTER(ALLSELECTED('Table'),[Part ID] = __PartID && [Month Date] <= __Date)
VAR __WhileLoop =
ADDCOLUMNS(
__Table,
"__Cumulative", SUMX(FILTER(__Table, [Month Date] <= EARLIER([Month Date])),[Amount])
)
VAR __Result = MINX(FILTER(__WhileLoop, __Cumulative >= 5), [Month Date])
RETURN
__Result
Yes I got the Result .I need to use squre bracket around that to get the result .Thank You so much man.
Can i apply Filter like Month ,Year ,Quarter to this Measure
@abhijeetbehuria Should be able to since using ALLSELECTED instead of ALL. ALLSELECTED should keep any filters external to the visual itself.
Thank You so much
@abhijeetbehuria Try:
Cumulative Total Measure =
VAR __PartID = MAX('Table'[Part_Id])
VAR __Date = MAX('Table'[Month Date])
VAR __Table = FILTER(ALLSELECTED('Table'),[Part ID] = __PartID && [Month Date] <= __Date)
VAR __Result = SUMX(__Table, [Amount])
RETURN
__Result
and
5 Rupee Measure =
VAR __PartID = MAX('Table'[Part_Id])
VAR __Date = MAX('Table'[Month Date])
VAR __Table = FILTER(ALLSELECTED('Table'),[Part ID] = __PartID && [Month Date] <= __Date)
VAR __WhileLoop =
ADDCOLUMNS(
__Table,
"__Cumulative", SUMX(FILTER(__Table, [Month Date] <= EARLIER([Month Date])),[Amount])
VAR __Result = MINX(FILTER(__WhileLoop, __Cumulative >= 5), [Month Date])
RETURN
__Result
Sir Please help me to Understand these two measure. I got the solution but not be able to understand it. It's my humble request.
It's giving me Error .
@abhijeetbehuria Sorry, missed a )
5 Rupee Measure =
VAR __PartID = MAX('Table'[Part_Id])
VAR __Date = MAX('Table'[Month Date])
VAR __Table = FILTER(ALLSELECTED('Table'),[Part ID] = __PartID && [Month Date] <= __Date)
VAR __WhileLoop =
ADDCOLUMNS(
__Table,
"__Cumulative", SUMX(FILTER(__Table, [Month Date] <= EARLIER([Month Date])),[Amount])
)
VAR __Result = MINX(FILTER(__WhileLoop, __Cumulative >= 5), [Month Date])
RETURN
__Result
Thanks Greg, this is working
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 127 | |
| 88 | |
| 78 | |
| 66 | |
| 65 |