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.
Hi guys,
I'm beginner in Power BI and need help.
I need a DAX column with my customer list that will show their sales in the slicers based on the year and item group selected from the sales data without the use of a relationship.
This is the sample result I'm looking for:
Test File - https://drive.google.com/file/d/10VLWUhmGCSoHUxvK4yeiR77mKlbNMBcA/view?usp=drive_link
Thank you in advance, and I appreciate everyone! 😊
Solved! Go to Solution.
Hi @elemesey ,
I updated your sample pbix file(see the attachment), please check if that is what you want.
1. Delete the relationship between the table 'Fiscal Year based on Sales' and 'Sales'
2. Create two measures as below
Measure =
VAR _cust =
SELECTEDVALUE ( 'Allcustomer'[Customer] )
VAR _fyears =
ALLSELECTED ( 'Fiscal Year based on Sales'[Fiscal Year 2] )
VAR _fmonths =
ALLSELECTED ( 'Fiscal Year based on Sales'[Fiscal Month] )
VAR _itemgroups =
ALLSELECTED ( Sales[Item Group] )
VAR _dates =
CALCULATETABLE (
VALUES ( 'Fiscal Year based on Sales'[Date] ),
FILTER (
'Fiscal Year based on Sales',
'Fiscal Year based on Sales'[Fiscal Year 2]
IN _fyears
&& 'Fiscal Year based on Sales'[Fiscal Month] IN _fmonths
)
)
RETURN
CALCULATE (
SUM ( 'Sales'[Sales] ),
FILTER (
ALLSELECTED ( 'Sales' ),
'Sales'[Customer] = _cust
&& 'Sales'[Date]
IN _dates
&& 'Sales'[Item Group] IN _itemgroups
)
)
Sum of sales = SUMX(VALUES('Allcustomer'[Customer]),[Measure])
Best Regards
Hi @elemesey ,
I updated your sample pbix file(see the attachment), please check if that is what you want.
1. Delete the relationship between the table 'Fiscal Year based on Sales' and 'Sales'
2. Create two measures as below
Measure =
VAR _cust =
SELECTEDVALUE ( 'Allcustomer'[Customer] )
VAR _fyears =
ALLSELECTED ( 'Fiscal Year based on Sales'[Fiscal Year 2] )
VAR _fmonths =
ALLSELECTED ( 'Fiscal Year based on Sales'[Fiscal Month] )
VAR _itemgroups =
ALLSELECTED ( Sales[Item Group] )
VAR _dates =
CALCULATETABLE (
VALUES ( 'Fiscal Year based on Sales'[Date] ),
FILTER (
'Fiscal Year based on Sales',
'Fiscal Year based on Sales'[Fiscal Year 2]
IN _fyears
&& 'Fiscal Year based on Sales'[Fiscal Month] IN _fmonths
)
)
RETURN
CALCULATE (
SUM ( 'Sales'[Sales] ),
FILTER (
ALLSELECTED ( 'Sales' ),
'Sales'[Customer] = _cust
&& 'Sales'[Date]
IN _dates
&& 'Sales'[Item Group] IN _itemgroups
)
)
Sum of sales = SUMX(VALUES('Allcustomer'[Customer]),[Measure])
Best Regards
User | Count |
---|---|
77 | |
77 | |
68 | |
67 | |
49 |
User | Count |
---|---|
108 | |
103 | |
93 | |
83 | |
64 |