Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 35 | |
| 31 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 75 | |
| 72 | |
| 38 | |
| 35 | |
| 25 |