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.
My problem is as it follows: I have 2 tables, the first one has the amount of products per date and the company ID from where that product is; the second one has the company ID and the company name. In order to calculate the amount of products that each company have in the last date of the selected month I wrote the Dax code as shown below:
When I put the Company Name as a row header in a matrix visual I am getting the wrong total. I've already tried the SUMMARIZE+SUMX, the IF+HASONFILTER and the SUMX methods but none of these actually worked. The DAX code of my attempts are listed below:
Solved! Go to Solution.
Hi @Gekko1 ,
If your goal is to calculate the amount of products that each company have in the last date of the selected month, please try following steps:
This is my test table:
Create a new column:
Month = FORMAT([Date],"mmmm")
Try following measure:
Measure = CALCULATE(
SUM('Table'[Amount]),
FILTER('Table','Table'[Month] = SELECTEDVALUE('Table'[Month]) &&
'Table'[Company ID] = SELECTEDVALUE('Table'[Company ID]) &&
'Table'[Date] = MAX('Table'[Date]))
)
Is this the result you want?
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Gekko1 ,
If your goal is to calculate the amount of products that each company have in the last date of the selected month, please try following steps:
This is my test table:
Create a new column:
Month = FORMAT([Date],"mmmm")
Try following measure:
Measure = CALCULATE(
SUM('Table'[Amount]),
FILTER('Table','Table'[Month] = SELECTEDVALUE('Table'[Month]) &&
'Table'[Company ID] = SELECTEDVALUE('Table'[Company ID]) &&
'Table'[Date] = MAX('Table'[Date]))
)
Is this the result you want?
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |