Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Solved! Go to Solution.
Hi @coolshib,
Please establish a relationship between 3 tables and try the following measure for
Total Sales =SUMX(Table3,IF(Table3[Mode]="Online",RELATED(Table1[Online Price]),RELATED(Table1[Offline Price]))*Table3[Qty])
Here is the snapshot of the output
You can download the Power Pivot file from here
Hope it helps
Hi,
You may download my PBI file from here.
Hope this helps.
Hi,
You may download my PBI file from here.
Hope this helps.
Thank you so much.. Great Help.
Best Regards
Shib
Hi,
If my reply helped, please mark it as Answer.
Hi @Ashish_Mathur,
Why the SUMX formule >
Total sales = SUMX(SUMMARIZE(Table1;Products[Product Name];'Mode of payment'[Mode];"ABCD";[Price per unit]*[Quantity sold]);[ABCD])
If this formule give the same results.
Total Sales2 = [Quantity sold]*[Price per unit]
Greets,
Ronald
Hi,
Your measure would give the correct row wise totals but the incorrect grand total.
Hi @Ashish_Mathur,
This one gives me also the correct grand total.
Total sales = SUMX(Table1;[Price per unit]*[Quantity sold])
I will understand wy to generate a virtual table with summarize.
Greets,
Ronald
Yes, you are right. We do not need to create a virtual Table. Thank you.
Hi Ashish ( @Ashish_Mathur ),
i have another query based on a similar situation. What if i have multiple mode of payments catrgorised under these two Payment Categories. For example, my Table 1 and Table 2 will remain same. There wont be any changes. if i would have a 4th table as follows
Table No.4
Type of Payment Mode
Cash Payment Offline
Gift Card Offline
Cheque Payment Offline
Credit Card Online
Debit Card Online
UPI Online
Then my Table No.3 would revised as follows
Hi,
In Table 1 and Table 3 as well, you will have to clarify the Type of payment. If that information can be shared, then i can edit my solution to match your requirement.
Hi @coolshib,
Please establish a relationship between 3 tables and try the following measure for
Total Sales =SUMX(Table3,IF(Table3[Mode]="Online",RELATED(Table1[Online Price]),RELATED(Table1[Offline Price]))*Table3[Qty])
Here is the snapshot of the output
You can download the Power Pivot file from here
Hope it helps
Thank you Mr.Chhabra ( @ChandeepChhabra ) for the solution. It works like a charm.
I have one more query regarding this issue, what if i have more than two modes of payment like "Online Transfer, Cash Payment, Credit Card, Debit Card" etc instead of "Offline & Online only".
Thank you so much for your promt reply.
Best Regards
Shib
You can establish a relation between Table1 and Table 3 with a bit of modification using Power Query
Please download the power bi file
I am trying to display same column calculation field (Online, offline). till not achieve..
you can try inthe mean while, i will provide dax formula which i has got upto till now....
Online Sales = CALCULATE(SUM('Product'[Sales.Quantity]) * SUM('Product-Price'[Online Price]), FILTER('Product', 'Product'[Category] = RELATED('Product-Price'[Category]) && 'Product'[Sales.Mode] = "Online"))
Offline Sales = CALCULATE(SUM('Product'[Sales.Quantity]) * SUM('Product-Price'[Offline Price]), FILTER('Product', 'Product'[Category] = RELATED('Product-Price'[Category]) && 'Product'[Sales.Mode] = "Offline"))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
130 | |
80 | |
53 | |
38 | |
35 |
User | Count |
---|---|
207 | |
82 | |
75 | |
55 | |
50 |