Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi all -
I have searched all over and can't find a solution. I'm attaching sample data and a sample PBIX file.
I have a dataset with dates, times, accounts and amounts. Each account could have multiple transactions during the day. The times are essentially categorical in that they represent a period of time (all transactions between say 7:00 and 8:00). The goal is to compute a running total each day and then find the minimum of that total for each day and be able to graph that value. I can get it working when a single account or no account is selected in the slicer, but if more than one account is chosen, I do not get the correct minimum value.
My measures:
Total Amount = SUM(Table1[Amount])
Running Account Balance (all accounts) =
CALCULATE([Total Amount],
FILTER(
ALLEXCEPT('Table1','Table1'[Date]),
'Table1'[Time] <= MAX('Table1'[Time])
)
)
Running Account Balance =
CALCULATE([Total Amount],
FILTER(
ALLEXCEPT(Table1,'Table1'[Account],'Table1'[Date]),
'Table1'[Time] <= MAX('Table1'[Time])
)
)
Min Running Bal =
var MinRunningBalNoAccount = minx('Table1',[Running Account Balance (all accounts)])
var MinRunningBalAccount = minx('Table1',[Running Account Balance])
Return
IF(ISFILTERED('Table1'[Account]),
MinRunningBalAccount,
MinRunningBalNoAccount)
When I select a single account or not account, I get the correct Min Running Bal. But if I select multiple accounts I don't. What I really want is for DAX to sum the running total for all selected accounts and THEN figure out the minimum.
I hope it is clear what I am talking about, but I'm happy to provide more details if needed.
I hope these links to the files work!
Excel File
PBIX File
Solved! Go to Solution.
You need to take the minimum at the appropriate granularity.
Try this:
Min Running Balance =
VAR _Summary_ =
ADDCOLUMNS(
SUMMARIZE ( Table1, Table1[Date], Table1[Time] ),
"@RunBal", [Running Account Balance]
)
RETURN
MINX ( _Summary_, [@RunBal] )
You need to take the minimum at the appropriate granularity.
Try this:
Min Running Balance =
VAR _Summary_ =
ADDCOLUMNS(
SUMMARIZE ( Table1, Table1[Date], Table1[Time] ),
"@RunBal", [Running Account Balance]
)
RETURN
MINX ( _Summary_, [@RunBal] )
This is perfect!! Thank you, I've been looking for this exact solution for a couple of weeks.
Now, how would I pull the corresponding date of when the minimum running balance occurs?
You could filter the summary table for the minimum balance row(s) and take the date column from the filtered table.
Min Running Balance Date =
VAR _Summary_ =
ADDCOLUMNS (
SUMMARIZE ( Table1, Table1[Date], Table1[Time] ),
"@RunBal", [Running Account Balance]
)
VAR _MinBal =
MINX ( _Summary_, [@RunBal] )
RETURN
MINX ( FILTER ( _Summary_, [@RunBal] = _MinBal ), Table1[Date] )
Absolutely genius...Thank you!
Perfect! Thanks so much. I knew I was at the wrong granularity, just couldn't quite get it tow work. Appreciate the help!
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 |
---|---|
15 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |