Forum Discussion
Measure total wrong
I created a measure where total is coming wrong. I tried options shown in other posts with has one filter, not working. Any help?
My measure looks like
Calculate(datediff(firstdate(table1[field1], last date(table2[field2]),day),userrelationship(table2(field3],table1[field4]))
Thanks
- Anonymous6 years agoYes,its measure total problem. When I added if( hasonefilter (table1[field1) at the front of created measure, total row goes away. For now I am okwith that
8 Replies
- edhansCommunity Champion
You had a number of syntax issues and spelling errors for functions. Try this:
measure = CALCULATE( DATEDIFF( FIRSTDATE( table1[field1] ), LASTDATE( table2[field2] ), DAY ), USERELATIONSHIP ( table2[field3], table1[field4] ) )It may still not work and provide the results you want, but it is, at least, syntactically correct.
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- AnonymousNot applicableThanks, it was my typo. My measure is working perfectly for each row. it’s just the total at bottom of table visual that is not showing right value. So I tried to add a part with Dax ,’has one filter’, But am not able to get the total row still right.
- edhansCommunity Champion
I have no idea then. You'll have to provide data, and the expected result, for anyone to tell you why your measure isn't working.
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
- NimishRegular Visitor
Hello
I got the measure total value wrong for one of a column in my Matrix Visual ( Column Name: CALC PRICE), which should be 0.22. Below is the matrix table and measure used to calculate that column
CALC PRICE = SUMPRICE * CALC
SUMPRICE = SUM ('TABLE'[PRICE])
CALC = DIVIDE ([SUMQTY , SUMQTYALL, BLANK())
SUMQTY = SUM('TABLE'[QTY]) & SUMQTYALL = CALCULATE(SUM('TABLE'[QTY],ALLSELECTED('TABLE'))
CAN ANYONE HELP IN HERE TO GET THE CORRECT COLUMN TOTAL!!
Year Month Number Site SKU QTY PRICE CALC QTY CALCULATION (CALC QTY) CALC PRICE CALCULATION (CALC PRICE) 2020 1 A 1234 17850 0.13 0.235178 17850/75900 0.0305731 0.235178*0.13 2020 11 B 1234 17850 0.13 0.235178 17850/75900 0.0305731 0.235178*0.13 2020 3 C 1234 17850 0.13 0.235178 17850/75900 0.0305731 0.235178*0.13 2020 6 D 1234 3700 0.32 0.048748 3700/75900 0.0155995 0.048748*0.32 2020 7 E 1234 18650 0.44 0.245718 18650/75900 0.1081159 0.245718*0.44 TOTAL 75900 1.15 1.15 - NimishRegular Visitor
Greg_Deckler edhans amitchandak hi guys can you please help in here
- Greg_DecklerCommunity Champion
Nimish First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e
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
Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8You might want to post this as a new post along with sample data, etc. This is a 3 year old thread that was closed.