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 everyone,
I saw this issue many times, but I just cant seem to fix it.
I am working with sales data (Product hierarchy, customers, Locations etc). Currently model has 2 calendars. One active and second inactive used to compare two time periods.
The main issue is measure that has IF statement inside and where totals arent working.
measure = IF(OR(price using calendar 1=0,price using calendar 2=0),
0,
(price from calendar 1-price from calendar 2)*quantity from calendar 1.
Measure from calendar 2 is using USERELATIONSHIP and works well.
When I use data in tables, it gives me good data per row. The problem is with totals and I just cant seem to find a workaround for IF.
Thank you!
Solved! Go to Solution.
Hi @MrMP
You might try something like :
CALCBF_New =
VAR _table =
SUMMARIZE ( Table1, Table1[column], "_Value", [measure] )
RETURN
IF ( HASONEVALUE ( Table1[column] ), [measure], SUMX ( _table, [_Value] ) )
Hi @MrMP
You might try something like :
CALCBF_New =
VAR _table =
SUMMARIZE ( Table1, Table1[column], "_Value", [measure] )
RETURN
IF ( HASONEVALUE ( Table1[column] ), [measure], SUMX ( _table, [_Value] ) )
@MrMP 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
@MrMP , In case of measures, the context of the row plays a row and the grand total are calculated again.
So when the same context is used in grand total it might miss that value and the total will not be the same.
That is why we force a total to be recalculated from row-level using values or summarize
Sumx(Values(Table[Group By]), [Measure])
Sumx(summarize( Table, Table[Group By], "_1", [Measure]),[_1])
refer these
https://www.youtube.com/watch?v=ufHOOLdi_jk
https://www.youtube.com/watch?v=Rii_6qkLNh8
https://www.youtube.com/watch?v=Ka7Ds4EAjNQ
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
217 | |
89 | |
82 | |
66 | |
57 |