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.
Hello Expert,
I need your help in getting the row subtotal value. I have given the example:
I am not able to get the sub total value through meaure. beacuse i need to divide row value with sub total value like(600,180,50,20).
Please help me to get the sub total value.
Thank you in advance
Solved! Go to Solution.
@Uzi2019 Try this DAX Measure:
Measure =
@Uzi2019 Try this DAX Measure:
Measure =
Thanks @Tahreem24
Your solution actually works for me.
Hi, @Uzi2019
You can try the following methods.
Sample data:
Measure =
Var _N1=SUM('Table'[Value])
Var _N2= CALCULATE(SUM('Table'[Value]),ALLEXCEPT('Table','Table'[Region],'Table'[Category]))
Return
DIVIDE(_N1,_N2)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-zhangti Thanks for your reply. I tried this already but I have few slicers of Year,Month, etc. when we select any value from slicer so measure values remain constant. I used ALLSELECTED as well but measure value is not changing as per slicer value selected.
Hi, @Uzi2019
Please provide sample data and expected output. Sensitive information can be removed in advance.
Best Regards
@v-zhangti Pasting smaple data and output below: (Measure should be working as per any value selected in Slicer by end user)
Expected Output:
Region | Category | Product | Spends | Measure |
East | A | AR KU | 100 | 0.166666667 |
East | LE FU | 200 | 200/600 | |
East | YUMM | 300 | 300/600 | |
East | Total | 600 | 600/600 | |
East | B | GO CR | 50 | 50/180 |
East | GO HA | 60 | 60/180 | |
East | GO PO | 70 | 70/180 | |
East | Total | 180 | 180/180 | |
North | A | POPP | 20 | 20/50 |
North | S GOU | 30 | 30/50 | |
North | Total | 50 | 50/50 | |
North | B | AARA | 20 | 20/40 |
North | N POT | 20 | 20/40 | |
North | Total | 40 | 20/20 |
Sample Data:
Regions | Category | Brand | Quantity | Year | Month |
East | A | GO TE | 29 | 2022 | Jan |
East | A | AR KU | 946 | 2022 | Feb |
East | A | AR KU | 962 | 2022 | Mar |
East | A | LE FU | 634 | 2022 | Apr |
East | A | YUMM | 677 | 2022 | May |
East | B | AJI K | -37 | 2022 | Jun |
East | B | ITOS | 1230 | 2022 | Jul |
East | B | ITOS | 1401 | 2022 | Aug |
East | B | SER-D | -35 | 2022 | Sept |
East | C | GO NO | 550 | 2022 | Oct |
East | C | X FRI | 2 | 2022 | Nov |
East | C | YUMM | -36 | 2022 | Dec |
East | C | APURN | -37 | 2022 | Jan |
East | D | GO CR | 635 | 2022 | Feb |
East | D | GO HA | 757 | 2022 | Mar |
East | D | GO PO | 2489 | 2022 | Apr |
East | D | GO WA | 1278 | 2022 | May |
East | D | POPP | -37 | 2022 | Jun |
East | D | S GOU | 42 | 2022 | Jul |
East | D | S SIZ | 2687 | 2022 | Aug |
East | D | S WAF | 2066 | 2022 | Sept |
East | D | AARA | -37 | 2022 | Oct |
East | D | N POT | -37 | 2022 | Nov |
East | D | AL MA | -37 | 2022 | Dec |
East | D | YUMM | -6 | 2023 | Jan |
East | D | II D | 204 | 2023 | Feb |
East | D | II H | 1368 | 2023 | Mar |
East | F | GO MA | 1993 | 2023 | Apr |
East | F | CRAX | -34 | 2023 | May |
East | F | X COR | 641 | 2023 | Jun |
East | F | X CUR | 152 | 2023 | Jul |
East | F | AR KU | 151 | 2023 | Aug |
East | F | AR KU | 215 | 2023 | Sept |
East | F | AR PA | -37 | 2023 | Oct |
East | F | YUMM | 220 | 2023 | Nov |
East | F | LOW D | 829 | 2023 | Dec |
East | G | DH NA | -37 | 2023 | Jan |
East | G | AJI B | -25 | 2023 | Feb |
East | G | AJI M | -34 | 2023 | Mar |
East | G | AJI S | -34 | 2023 | Apr |
East | G | AJI T | -37 | 2023 | May |
East | G | ANO B | -36 | 2023 | Jun |
East | G | K FAR | -37 | 2023 | Jul |
East | G | MUKHA | -37 | 2023 | Aug |
East | G | SNAC | -37 | 2023 | Sept |
East | G | UJI N | -37 | 2023 | Oct |
East | G | DIRAM | -37 | 2023 | Nov |
East | G | DIRAM | -36 | 2023 | Dec |