Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have three main measures in my data model:
sales = DISTINCTCOUNT(Sales[Product ID])
Here find attached the Power BI model. https://drive.google.com/file/d/1izQnlhw_geZtn4bfe5T-by3BB__mbwFK/view?usp=sharing
Thank you in advance for your help!
Best,
Sara
Solved! Go to Solution.
Try this measure:
cum_conv =
VAR vCurrentMonth =
MAX ( 'Calendar'[Month Number] )
VAR vTable =
ADDCOLUMNS ( ALLSELECTED ( 'Calendar'[Month Number] ), "@conv", [conv] )
VAR vResult =
SUMX ( vTable, IF ( 'Calendar'[Month Number] <= vCurrentMonth, [@conv] ) )
RETURN
vResult
Proud to be a Super User!
I wasn't able to access the pbix via the link. This is the basic pattern for a cumulative sum:
cum_conv =
CALCULATE (
[conv],
FILTER (
ALL ( 'Calendar' ),
'Calendar'[Month Number] <= MAX ( 'Calendar'[Month Number] )
)
)
Proud to be a Super User!
Hi @DataInsights,
Thank you very much for your answer!
I tried before this formula, but for some reason, it is not working.
I also tried SUMX = (FILTER (ALL('Calendar'),'Calendar'[Month Number] <=MAX('Calendar'[Month Number]), [conv])), but I still do not obtain the desired result.
I shared the Power BI model via Drive, let me know if you can download it from there.
Best regards,
Sara
Try this measure:
cum_conv =
VAR vCurrentMonth =
MAX ( 'Calendar'[Month Number] )
VAR vTable =
ADDCOLUMNS ( ALLSELECTED ( 'Calendar'[Month Number] ), "@conv", [conv] )
VAR vResult =
SUMX ( vTable, IF ( 'Calendar'[Month Number] <= vCurrentMonth, [@conv] ) )
RETURN
vResult
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
37 | |
25 | |
19 | |
14 | |
8 |
User | Count |
---|---|
68 | |
48 | |
45 | |
18 | |
15 |