Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello, I am somewhat new to Power BI so any help is very much appreciated.
I have a dataset with a Product column and a Created Date coulmn
example would be: Product Column = X, Created Date Column = 1/1/2019
I would like to create a measure that will count the number of records that = Product X and Date = Q1 2019
I assume I can plug in different values for different products/dates but I cannot figure out the DAX for the measure.
Thank you!
Matt
Solved! Go to Solution.
HI @Matt0515,
Do you mean to calculate with specific dare range and produce records count or dynamic calculate based on current product and date? If you mean static conditions, you can try to use the following measure formula:
Measure =
CALCULATE (
COUNTROWS ( Table ),
FILTER (
ALLSELECTED ( Table ),
Table[Product] = "X"
&& YEAR ( Table[Date] ) = 2019
&& QUARTER ( Table[Date] ) = 1
)
)
For the dynamic version, you need to extract current date and product for calculating:
Measure =
VAR currDate =
MAX ( Table[Date] )
RETURN
CALCULATE (
COUNTROWS ( Table ),
FILTER (
ALLSELECTED ( Table ),
Table[Product] IN VALUES ( Table[Product] )
&& YEAR ( Table[Date] ) = YEAR ( currDate )
&& QUARTER ( Table[Date] ) = QUARTER ( currDate )
)
)
Regards,
Xiaoxin Sheng
HI @Matt0515,
Do you mean to calculate with specific dare range and produce records count or dynamic calculate based on current product and date? If you mean static conditions, you can try to use the following measure formula:
Measure =
CALCULATE (
COUNTROWS ( Table ),
FILTER (
ALLSELECTED ( Table ),
Table[Product] = "X"
&& YEAR ( Table[Date] ) = 2019
&& QUARTER ( Table[Date] ) = 1
)
)
For the dynamic version, you need to extract current date and product for calculating:
Measure =
VAR currDate =
MAX ( Table[Date] )
RETURN
CALCULATE (
COUNTROWS ( Table ),
FILTER (
ALLSELECTED ( Table ),
Table[Product] IN VALUES ( Table[Product] )
&& YEAR ( Table[Date] ) = YEAR ( currDate )
&& QUARTER ( Table[Date] ) = QUARTER ( currDate )
)
)
Regards,
Xiaoxin Sheng
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 54 | |
| 47 | |
| 39 | |
| 16 | |
| 15 |
| User | Count |
|---|---|
| 83 | |
| 71 | |
| 39 | |
| 29 | |
| 27 |