March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have created a measure to caluclate the difference in price this month vs last month and now I want to count all the number of products that have had the price change, please can you advise how this can be done.
Price change = Calculate(IF([Previous Month]=0, 0,[Current Month]-[Previous Month]),'All detail'[Month] = MAX('All detail'[Month]))
article | Aug | July |
x | 10 | 5 |
y | 5 | 3 |
z | 15 | 15 |
a | 12 | 12 |
a | 10 | 7 |
c | 20 | 8 |
Solved! Go to Solution.
To count the number of products that have had a price change, you can create a new measure that evaluates whether the "Price change" measure is not equal to 0 for each product. You can use the COUNTROWS function to count the rows where this condition is met. Here's how you can do it:
DAX Formula:
Price Change Count =
COUNTROWS(
FILTER(
SUMMARIZE('All detail', 'All detail'[article]),
[Price change] <> 0
)
)
This measure will count the number of products (articles) that have had a price change during the specified period. It uses the FILTER function to create a filtered table where the "Price change" measure is not equal to 0, and then COUNTROWS counts the rows in that filtered table.
Now, when you use the "Price Change Count" measure in your visualizations or tables, it will display the count of products with price changes for the given month.
To count the number of products that have had a price change, you can create a new measure that evaluates whether the "Price change" measure is not equal to 0 for each product. You can use the COUNTROWS function to count the rows where this condition is met. Here's how you can do it:
DAX Formula:
Price Change Count =
COUNTROWS(
FILTER(
SUMMARIZE('All detail', 'All detail'[article]),
[Price change] <> 0
)
)
This measure will count the number of products (articles) that have had a price change during the specified period. It uses the FILTER function to create a filtered table where the "Price change" measure is not equal to 0, and then COUNTROWS counts the rows in that filtered table.
Now, when you use the "Price Change Count" measure in your visualizations or tables, it will display the count of products with price changes for the given month.
Thank you much appreciated. The solution worked.
You welcome.
User | Count |
---|---|
117 | |
77 | |
58 | |
52 | |
46 |
User | Count |
---|---|
171 | |
117 | |
63 | |
57 | |
51 |