Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
83 | |
69 | |
68 | |
39 | |
37 |