Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi all - I'm building a running total from the quick measure tool but when the matrix comes across a column where the data would be blank - it's throwing the full value into the column and killing my report.
EXAMPLE: I am working on a diminishing report of how many times patients order. One order would be the full amount of patients, then 2 would be smaller, then 3 smaller and so on. But, when it gets to a column where no patient exists, it throws the full amount (see chart for example). In 2022, most patients will only have bought 1 or maybe 2 times...but when it populates, 3, 4, 5 etc show the amount of patients enrolled instead of 0.
Can anyone help me figure out what I need to write in the formula to make it appear BLANK() instead of total?
Thanks
DAX:
Solved! Go to Solution.
Try:
Count of Consumer ID running total in Orders on Autoship =
IF (
ISBLANK ( DISTINCTCOUNT ( 'Order Product'[Consumer ID] ) ),
BLANK (),
CALCULATE (
DISTINCTCOUNT ( 'Order Product'[Consumer ID] ),
FILTER (
ALLSELECTED ( 'Lead'[Orders on Autoship] ),
ISONORAFTER (
'Lead'[Orders on Autoship], MIN ( 'Lead'[Orders on Autoship] ), ASC
)
)
)
)
Proud to be a Super User!
Paul on Linkedin.
Try:
Count of Consumer ID running total in Orders on Autoship =
IF (
ISBLANK ( DISTINCTCOUNT ( 'Order Product'[Consumer ID] ) ),
BLANK (),
CALCULATE (
DISTINCTCOUNT ( 'Order Product'[Consumer ID] ),
FILTER (
ALLSELECTED ( 'Lead'[Orders on Autoship] ),
ISONORAFTER (
'Lead'[Orders on Autoship], MIN ( 'Lead'[Orders on Autoship] ), ASC
)
)
)
)
Proud to be a Super User!
Paul on Linkedin.
This worked PERFECTLY! It removed all the totals when not necessary and gave me exactly what I needed.
Thanks @PaulDBrown
You use functions like HASONEVALUE() or ISFILTERED() with the combination of IF().
Hope this helps!
I'm not sure what the DAX would look like - I tried to create my DAX as a variable and do an IF statement but it either didn't change, or errored out.
Could you share what it might look like?
Thanks
Try using HASONEVALUE() like this:
Measure =
VAR YourCalculateLogic = ...
VAR Result = IF(HASONEVALUE(table[Year]), YourCalculateLogicm Blank())
RETURN
Result
Or you can hide the total row in the setting:
Consider giving a thumbs up if this is helpful!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
79 | |
54 | |
39 | |
35 |
User | Count |
---|---|
102 | |
80 | |
48 | |
48 | |
48 |