March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi have the following table that includes a Street Name, No of Properties (which is a measure of the Count of UPRNs) and I want to add a Cummulative Measure for me to add a to a matrix.
Please can someone tell me how I would write the DAX please.
@amitchandak @tamerj1 @goncalogeraldes
Solved! Go to Solution.
Hi @spandy34 ,
With this measure calculating the number of properties (without cummulation):
# Properties = SUM ( 'Properties by Street'[No of Properties] )
this measure calculates the cummulative number of properties by street:
# Properties cummulating by street =
VAR _UpToStreet = MAX ( 'Properties by Street'[STREE_NAME] )
RETURN
CALCULATE (
[# Properties],
'Properties by Street'[STREE_NAME] <= _UpToStreet
)
Be aware that the order by which is cummulated is defined by the measure, not by the visual. I.e., if you sort the table by a different column, cummulation is not done top to bottom but still by street name alphabetically ascending. If you want to cummulate differently, you need a different measure.
BR
Martin
Hi @spandy34
please try
Cumulative =
VAR CurrentStreet =
SELECTEDVALUE ( 'Table'[STREET_NAME] )
RETURN
SUMX (
FILTER (
ALLSELECTED ( 'Table'[STREET_NAME] ),
'Table'[STREET_NAME] <= CurrentStreet
),
[No of Properties]
)
Thank you it's worked appreciate your response.
Hi @spandy34
please try
Cumulative =
VAR CurrentStreet =
SELECTEDVALUE ( 'Table'[STREET_NAME] )
RETURN
SUMX (
FILTER (
ALLSELECTED ( 'Table'[STREET_NAME] ),
'Table'[STREET_NAME] <= CurrentStreet
),
[No of Properties]
)
Hi @spandy34 ,
With this measure calculating the number of properties (without cummulation):
# Properties = SUM ( 'Properties by Street'[No of Properties] )
this measure calculates the cummulative number of properties by street:
# Properties cummulating by street =
VAR _UpToStreet = MAX ( 'Properties by Street'[STREE_NAME] )
RETURN
CALCULATE (
[# Properties],
'Properties by Street'[STREE_NAME] <= _UpToStreet
)
Be aware that the order by which is cummulated is defined by the measure, not by the visual. I.e., if you sort the table by a different column, cummulation is not done top to bottom but still by street name alphabetically ascending. If you want to cummulate differently, you need a different measure.
BR
Martin
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
16 | |
12 | |
9 | |
7 |
User | Count |
---|---|
38 | |
32 | |
28 | |
12 | |
11 |