Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi,
Insert Time | Product 1 | Product 2 | Location | Category | Supplier | Qty | Week Date | Condition | Duplication Check |
I have the above Table
I need a DAX which calculates the Grand Total Basis conditions.
If Condition = 1 Then Calculate Grand Total Per Week
If Condition = 2 Then Calculate Grand Total Per Week
Hello @helloworld12
If there’s exactly one condition in the current filter context, you can try the DAX logic below,
SWITCH(
TRUE(),
SELECTEDVALUE('Table'[Condition]) = 1,
CALCULATE(
SUM('Table'[Qty]),
ALLEXCEPT('Table', 'Table'[Week Date])
),
SELECTEDVALUE('Table'[Condition]) = 2,
CALCULATE(
SUM('Table'[Qty]),
ALLEXCEPT('Table', 'Table'[Week Date]) //adjust if logic differs
)
)
ALLEXCEPT('Table', 'Table'[Week Date]) forces totals at the week level, ignoring product, supplier, category, etc.
Hi @helloworld12
@MasonMA @FBergamaschi Thanks for the inputs.
I hope the information provided by users was helpful. If you still have questions, please don't hesitate to reach out to the community.
I wanted to check if you had the opportunity to review the information provided by users. Please feel free to contact us if you have any further questions.
Hope everything’s going smoothly on your end. I wanted to check if the issue got sorted. if you have any other issues please reach community.
Hi @helloworld12, a coupld of things
1 - Can you please clarify the below? It seems the same thing is requested in both conditions
If Condition = 1 Then Calculate Grand Total Per Week
If Condition = 2 Then Calculate Grand Total Per Week
2 - Please include, in a usable format, not an image, a small set of rows for each of the tables involved in your request and show the data model in a picture, so that we can import the tables in Power BI and reproduce the data model. The subset of rows you provide, even is just a subset of the original tables, must cover your issue or question completely. Alternatively, you can share your .pbix via some cloud service and paste the link here. Do not include sensitive information and do not include anything that is unrelated to the issue or question. Please show the expected outcome based on the sample data you provided and make sure, in case you show a Power BI visual, to clarify the columns used in the grouping sections of the visual.
Need help uploading data? click here
Want faster answers? click here
User | Count |
---|---|
15 | |
11 | |
6 | |
6 | |
5 |
User | Count |
---|---|
30 | |
18 | |
11 | |
7 | |
5 |