Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi there,
I am trying to calculate the number of rows that have either Units or Stock greater than zero in the last 2 months.
Units and Stock are in my fact table.
Fact table has the following columns Date, ProdID, StoreID, Units, Stock
I also have a calendar table.
The result I am looking for is the number of rows in the fact table that has either Units OR Stock in the last 2 Months.
My fact table is rather larger so I cant add a calculated column.
Solved! Go to Solution.
You may refer to the following measure.
Measure = VAR y = YEAR ( TODAY () ) VAR m = MONTH ( TODAY () ) RETURN COUNTROWS ( FILTER ( 'Fact', 'Fact'[Date] >= DATE ( y, m - 1, 1 ) && ( 'Fact'[Units] > 0 || 'Fact'[Stock] > 0 ) ) )
You may refer to the following measure.
Measure = VAR y = YEAR ( TODAY () ) VAR m = MONTH ( TODAY () ) RETURN COUNTROWS ( FILTER ( 'Fact', 'Fact'[Date] >= DATE ( y, m - 1, 1 ) && ( 'Fact'[Units] > 0 || 'Fact'[Stock] > 0 ) ) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |