The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
How can i build a store wise monthly report for total charges from below table_1 and table_2
total charges: = Table_1[Charges]+Table_2[Monthly charges]
Table_1
Date | Stores | Charges |
01-Jul-22 | Store1 | 350 |
01-Jul-22 | Store2 | 100 |
02-Jul-22 | Store1 | 500 |
02-Aug-22 | Store2 | 1200 |
03-Aug-22 | Store1 | 200 |
03-Aug-22 | Store2 | 50 |
04-Aug-22 | Store1 | 50 |
04-Aug-22 | Store2 | 50 |
Fixed monthly charges for each month in table_2
Table_2
Store | Monthly charges |
Store1 | 2000 |
Store2 | 3000 |
Solved! Go to Solution.
Hi,
I am not sure how your expected visualization looks like, but please check the below picture and the attached pbix file.
Monthly charge measure: =
IF (
SUM ( Table_1[Charges] ) = BLANK (),
BLANK (),
SUM ( Table_1[Charges] ) + SUM ( Table_2[Monthly charges] )
)
Hi,
Thank you for your feedback.
Table_1 is filtered by the calendar table, and a SUM function that aggregates Table_1 is influenced by the calendar table. However, Table_2 is not filtered by the calendar table in this data model, and a SUM function that aggregates Table_2 is not influenced by the calendar table, and it shows same amount in every month.
I hope this helps you to have better understanding.
Thanks.
Hi,
I am not sure how your expected visualization looks like, but please check the below picture and the attached pbix file.
Monthly charge measure: =
IF (
SUM ( Table_1[Charges] ) = BLANK (),
BLANK (),
SUM ( Table_1[Charges] ) + SUM ( Table_2[Monthly charges] )
)
Thanks you for support, you did this so cleanly.
I am still learning the dax and just want to know how is it working ?
Hi,
Thank you for your feedback.
Table_1 is filtered by the calendar table, and a SUM function that aggregates Table_1 is influenced by the calendar table. However, Table_2 is not filtered by the calendar table in this data model, and a SUM function that aggregates Table_2 is not influenced by the calendar table, and it shows same amount in every month.
I hope this helps you to have better understanding.
Thanks.
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |