Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I'm trying to do the simplest calculation here. A have a table with a Date Key column and a colum "IsPayday", which is of Type Whole number.
I want to have a running total of the second one and have tried many variations of the formula below, but haven't figured it out:
Thanks for your help!
Solved! Go to Solution.
try
Is Payday running total =
VAR MaxDate =
MAX ( 'Calendar'[Datekey] )
VAR Result =
CALCULATE ( SUM ( 'Calendar'[Is payday] ), 'Calendar'[Datekey] <= MaxDate )
RETURN
Result
Thank for your help.
I decided to change the source data and add ispayday as boolean in the data warehouse. With the field imported into Power BI I used the following variation of your code and got the calculation working:
Is Payday running total =
VAR MaxDate =
MAX ( 'Calendar'[Datekey] )
VAR Result =
CALCULATE(COUNTROWS('Calendar'), 'Calendar'[Datekey] <= MaxDate && 'Calendar'[ispayday] = true )
RETURN
Result
try
Is Payday running total =
VAR MaxDate =
MAX ( 'Calendar'[Datekey] )
VAR Result =
CALCULATE ( SUM ( 'Calendar'[Is payday] ), 'Calendar'[Datekey] <= MaxDate )
RETURN
Result
Thanks for your help @johnt75
I tried it and have this error:
IsPayday is a custom column that I created in the Power Query Editor. Can that be the problem?
You have an extra ] after IsPayday
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
79 | |
59 | |
36 | |
35 |
User | Count |
---|---|
99 | |
57 | |
56 | |
46 | |
40 |