Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello Experts,
Data:
Expected Result:
- Calculate sum of Sales only if Units is not blank
- Sales Sum = 10 + 20 + 40 = 70; Sales = 30 for XYZ is skipped since Units is blank for it
I'm using below dax in calculated measure but it is not working:
Solved! Go to Solution.
@atult This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Hi @atult ,
Try below dax:
Total Sales =
CALCULATE(
SUM('Sales_Table'[Sales]),
'Sales_Table'[Units] <> BLANK()
)
For ease of Filtered Measure DAX, you can directly go to quick measure -> filtered value and then change your dax accordingly.
Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!! Proud To Be a Super User !!! |
Hi @atult ,
Try below dax:
Total Sales =
CALCULATE(
SUM('Sales_Table'[Sales]),
'Sales_Table'[Units] <> BLANK()
)
For ease of Filtered Measure DAX, you can directly go to quick measure -> filtered value and then change your dax accordingly.
Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!! Proud To Be a Super User !!! |
@atult Perhaps try this:
Total Sales = IF(SUM('Sales_Table'[Units]) <= 0,BLANK(),SUM('F_ORDERED Sales_Table'[Sales]))
@atult This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
@Greg_Deckler ,
Tried the below but not helping:
Total Sales =
IF(
HASONEFILTER(Sales_Table[Category]),
IF(
SUM(Sales_Table[Units]) = BLANK(),0,SUM(Sales_Table[Sales])
),
SUMX(
FILTER(Sales_Table,
[Units]>1000
),
[Sales]
)
)
@atult Keep your original measure. Create a new measure:
Total Sales =
IF(
HASONEFILTER(Sales_Table[Category]),
[Original Measure],
SUMX(SUMMARIZE('Table',[Category],"__Sales",[Original Measure]),[__Sales])
)
For Measure Totals to work, you have to summarize or summarizecolumns or groupby your data exactly as it is in the visual and then use an X aggregator across that summarized table.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
124 | |
79 | |
49 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |