Forum Discussion
Adding new column for the total target
Hi,
I faced an issue and I will happy if I get a help from you.
I want to add new column contains the total target.
My table name is Daily_targets
I have here a column with the Retail targets data
the daily_targets table has a relationship with Sales table (this table appearing daily sales). the relationship by (column date_branchcode) column
I configured slicers like this to show the data untill today and it is work correctly in Target TD
I want to add another column with name ( Total targe) which contain the total retail target data based on the slicer selection
EX: if I select QTD > the data for this column will be the whole retail targets for this quarter
if we in Feb month , the total target column will show jan - feb - mar targets.
I tried many things but the data still apparing QTD (until today).
How I can fixed that to make the data shows all the current Quarter?
same thing in other filters (MTD, YTD)
manar_alamri , The target should not join with sales, both should join with a common dimension like date. You can create QTD, YTD measures using TI and switch them using calculation groups or field parameters
QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))Power BI- DAX: When I asked you to create common tables: https://youtu.be/a2CrqCA9geM
https://medium.com/@amitchandak/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solution-8e3eccb41bda
1 Reply
- amitchandak
Super User
manar_alamri , The target should not join with sales, both should join with a common dimension like date. You can create QTD, YTD measures using TI and switch them using calculation groups or field parameters
QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))Power BI- DAX: When I asked you to create common tables: https://youtu.be/a2CrqCA9geM
https://medium.com/@amitchandak/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solution-8e3eccb41bda