The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi everyone, I cannot understand why the total does not SUM correctly.
In the following table I am making measurements of:
Id_Name = Distinctcount (Table1 [Id_Name]) ... OK
Sales Check = Distinctcount (Table1 [Id_SalesCheck]) ... OK
here I can not show what is seen in the table.
2 or more Purchas = If (Sales Check > 1, Distinctcount (Table1 [Id_Name]), BLANK())
I tried SUMX but the result was an out-of-itself number.
SUMX (Table1, Distinctcount (Table1 [Id_Name]))
I try to do my best but I'm really frustrated, I need help
This next table make in Excel and Show how I want to see, really I want to correctly sum total.
Solved! Go to Solution.
Hi , @GKs
Please check this sample file:
pbix attached
Try measure as below:
Measure = SUMX(VALUES('Table1'[Id_Name]),'Table1'[2 or more Purchas])
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi , @GKs
Please check this sample file:
pbix attached
Try measure as below:
Measure = SUMX(VALUES('Table1'[Id_Name]),'Table1'[2 or more Purchas])
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Basically, there's a filter context on each row of your table, e.g. ID_Name = 1 is the filter context on your first row. But the issue is with the Total as there's no such filter on that.
Here you can try use HASONEVALUE to check if Id_name has single value. If it's return false, it means you are on "Total" row, which means there's no Id_name filter on that and it returns all values.
I might suggest you take a look below, which might help.
Try something like this:
Measure 2 =
COUNTX(
FILTER('Table',
'Table'[Sales Check] > 1
),
'Table'[Sales Check]
)
The issue is your measure works fine and it is doing what you asked. Remember measures are recalculated for every place they are used. The total lines do not have a different formula that just sums what is above it. It recalculates the measure based on the filter context of where it is, which is the total line with no filters for the ID. So, in your total, the measure is recalculating and doing this:
If you need further help, please post usable data via the links below. We cannot use images for data samples.
How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI Reporting