The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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!
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
5 |
User | Count |
---|---|
33 | |
13 | |
11 | |
9 | |
8 |