Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
benjames
Frequent Visitor

DAX Calculation Won't Display Result

I have a table with 4 columns, Store #, Header ID, Transaction Date, Amount.  With this DAX "1" and "2" end up with values based on the sum; these values can be filtered by Store # or Date.  "3" doesn't have any transactions, this should be a value between the division of "1" and "2".  I'm at a loss at how to change this so that "3" will show a value as well as filter as required.

 

To test, I did make a fake $0 transaction for "3" on another sheet and then merged it into the transaction table.  This then gives me a percentage but it's all numbers being divided and it won't filter by Store #.

 

Any help would be greatly appreciated! 

 
Format Totals =
VAR Val = Sum('office posted_transaction_item'[amount])
 
VAR Val3 = Divide
(CALCULATE(sum('posted_transaction_item'[amount]),
Filter(ALL('posted_transaction_item'), 'office posted_transaction_item'[Header ID] = "2")),
   
CALCULATE(sum('posted_transaction_item'[amount]),
Filter(ALL('posted_transaction_item'), 'office posted_transaction_item'[Header ID] = "1")))

 

Return
Switch

 

(Selectedvalue ('posted_transaction_item'[Header ID]),

 

"1", Format (Val, "#,##0;(#,##0)"),
"2", Format (Val, "#,##0;(#,##0)"),
"3", Format (Val3, "Percent"))
1 REPLY 1
lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.