Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Dear All,
I'm still learning the DAX language. And I'm having a hard time.
I have a scenario where I need to get the correct COMPONENT HOURS. The result I want is in the Car Filter Context but if I change it to YEAR MONTH Filter context it gives me different value. . I'll show in below table.
Total COMPONENT HRS = 278896 - The correct One.
What I mean is the sum of the first table when calculated manually. Not the actual results in Powerbi. Both totals either CAR Filter Context or YEAR MONTH context provide wrong output in my powerbi.
CARS | US REMOVAL | HOURS | QPA FINAL 2 | COMPONENT HRS |
A1 | 2 | 4519 | 2 | 9039 |
A2 | 2 | 4013 | 2 | 8026 |
A3 | 3 | 4839 | 2 | 9679 |
A4 | 2 | 4654 | 2 | 9309 |
A5 | 2 | 4619 | 2 | 9237 |
A6 | 0 | 4718 | 2 | 9437 |
A7 | 1 | 4781 | 2 | 9561 |
A8 | 1 | 4779 | 2 | 9558 |
A9 | 1 | 4708 | 2 | 9416 |
A10 | 1 | 4592 | 2 | 9183 |
A11 | 1 | 4797 | 2 | 9594 |
A12 | 0 | 4679 | 2 | 9358 |
A13 | 1 | 4534 | 2 | 9068 |
A14 | 1 | 4499 | 2 | 8997 |
A15 | 1 | 4591 | 2 | 9181 |
A16 | 1 | 4901 | 2 | 9801 |
A17 | 1 | 4615 | 2 | 9230 |
A18 | 1 | 4594 | 2 | 9188 |
A19 | 2 | 4633 | 2 | 9266 |
A20 | 0 | 4171 | 2 | 8342 |
A21 | 2 | 4944 | 2 | 9889 |
A22 | 3 | 4708 | 2 | 9416 |
A23 | 0 | 4953 | 2 | 9906 |
A24 | 1 | 4858 | 2 | 9716 |
A25 | 0 | 4960 | 2 | 9921 |
A26 | 1 | 4295 | 2 | 8591 |
A37 | 0 | 4448 | 2 | 8896 |
A38 | 2 | 4575 | 2 | 9150 |
A39 | 0 | 4569 | 2 | 9138 |
A40 | 0 | 4552 | 2 | 9104 |
A41 | 0 | 143 | 2 | 286 |
A42 | 0 | 92 | 2 | 184 |
A43 | 0 | 114 | 2 | 229 |
Below table shows the wrong values.
I get a total of which is wrong.
366393 |
YearMonth | US12Months | FH12Months | QPA FINAL | COMPONENT HRS |
2023-03 | 41 | 170168 | 2 | 29137 |
2023-04 | 40 | 170685 | 2 | 29526 |
2023-05 | 37 | 171883 | 2 | 31492 |
2023-06 | 38 | 172874 | 2 | 29659 |
2023-07 | 42 | 173659 | 2 | 30337 |
2023-08 | 41 | 174344 | 2 | 29993 |
2023-09 | 42 | 175523 | 2 | 28984 |
2023-10 | 34 | 177035 | 2 | 31274 |
2023-11 | 33 | 178162 | 2 | 30088 |
2023-12 | 32 | 179160 | 2 | 31974 |
2024-01 | 31 | 180845 | 2 | 32898 |
2024-02 | 33 | 183196 | 2 | 31031 |
What I understand is in the first table above where there are red fonts. Its still included in the calculations when changed to Year Month Filter Context. Is there a way not to include them? I tried all the options such as adding IF(ISBLANK()) but its not working.
You should try a SUMX in your measure. Right now, your measure total is the total of car usage (183196) * total of QTY per usage (2) which is wrong for you.
You want to do the multiplaction for each row and then sum all the results.
Try something like SUMX('CARS MODEL', [CARS USAGE] * [QTY PER CAR])
Hello, i'm sorry but your explanation is not clear. I understand that the total is wrong is your table but that you calculated it yourself in the source.
Can you show us the measure if you have one, the total given by Power BI in the bottom of your table and the model with the relationships if there is more than one table involved ?
If in power bi, you put the SUM of component hours without axes, it shows you the correct answer ? if yes, the result shouldn't change when you add axes. if no, the problem is maybe in power query or in the query you use in your source.
User | Count |
---|---|
57 | |
48 | |
18 | |
16 | |
15 |
User | Count |
---|---|
116 | |
42 | |
41 | |
28 | |
21 |