Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Dear all,
I need help with DAX to bring sales value in to my calendar.
The first table [Sales-dailyUpdate] I have two columns, one is the [Sale amount] and another is the [Activation date], the other table is the [Calendar] which I have the [Date] column.
I am strugling to bring those sales into the calendar dates populating the total sum from my [Sales-dailyUpdate] table to a single date from the [Calendar] date.
Please help me with some ideas or solution.
Thanks in advance,
Figueiredo Luis
Solved! Go to Solution.
Sorry, based on your initial description I assumed you already had them calculated in the sales table.
try this:
Pretty much the same thing but in a different way, I use the below methodology. Then to get the value in a visual you can return the max value of the SalesAmount for the GroupKey. (There will only be one value, so MAX will return the actual value for the group). This is a generic example that could be adapted, but I thought it might be useful. Concat is a column that you want to group by, that could be a concatenation of other columns.
I appreciate you support DOLEARY85.
No problem, happy to help 🙂
You can use a measure in DAX to calculate the total sales amount for each date in your calendar table based on the sales data in your [Sales-dailyUpdate] table.
Here's an example measure you can use:
Total Sales = SUM('Sales-dailyUpdate'[Sale amount])
To display this measure in your calendar table, create a relationship between your [Calendar] table and [Sales-dailyUpdate] table using the [Activation date] and [Date] columns respectively. Then, add the Total Sales measure to your calendar table as a new column. The measure will automatically aggregate the sales amounts for each date in the [Sales-dailyUpdate] table and display the total sales amount for each date in the calendar table.
Here's an example DAX formula to create a new column in your [Calendar] table to show the total sales amount for each date:
Total Sales = CALCULATE([Total Sales], USERELATIONSHIP('Sales-dailyUpdate'[Activation date], 'Calendar'[Date]))
This formula uses the CALCULATE function to calculate the Total Sales measure for each date in the [Calendar] table, using the relationship between the [Sales-dailyUpdate] table and [Calendar] table.
Once you add this formula to a new column in your [Calendar] table, you will see the total sales amount for each date in your calendar.
Hi,
you can create a calculated column in the date table and use lookupvalue to bring it through:
Hi,
I don't think LOOKUPVALUE could work cos on the Sales-dailyUpdate we can find more than one sale in the same day while in calendar there is only one day.
In other words LOOKUPVALUE is expected to return a single value.
Sorry, based on your initial description I assumed you already had them calculated in the sales table.
try this:
Pretty much the same thing but in a different way, I use the below methodology. Then to get the value in a visual you can return the max value of the SalesAmount for the GroupKey. (There will only be one value, so MAX will return the actual value for the group). This is a generic example that could be adapted, but I thought it might be useful. Concat is a column that you want to group by, that could be a concatenation of other columns.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
75 | |
43 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |