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.
Hello,
I have a table that looks something like the one below. It summarizes the daily number of products sold by a retailer in a shopping center in the month of January.
How do I write a measure using DAX such that I can
- calculate the total number of products sold in the 7 days of January
- calculate the total number of products sold in the between 2 dates
So that the output PBI table that I need to display looks like this:
Solved! Go to Solution.
@Anonymous , Assume one is range selected and one we have the force
calculate(sum(Table[product sold]), filter(Date, Date[Date] >=date(2021,1,1) && Date[Date] <=date(2021,1,7) ))
if date is connected
measure =
var _min = minx(allselected('Date'), 'Date'[Date])
var _max = maxx(allselected('Date'), 'Date'[Date])
return
calculate(sum(Table[product sold]))
You can use an independent table
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
How to use two Date/Period slicers :https://www.youtube.com/watch?v=WSeZr_-MiTg
@Anonymous , Assume one is range selected and one we have the force
calculate(sum(Table[product sold]), filter(Date, Date[Date] >=date(2021,1,1) && Date[Date] <=date(2021,1,7) ))
if date is connected
measure =
var _min = minx(allselected('Date'), 'Date'[Date])
var _max = maxx(allselected('Date'), 'Date'[Date])
return
calculate(sum(Table[product sold]))
You can use an independent table
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
How to use two Date/Period slicers :https://www.youtube.com/watch?v=WSeZr_-MiTg
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.
User | Count |
---|---|
82 | |
78 | |
52 | |
39 | |
35 |
User | Count |
---|---|
94 | |
79 | |
51 | |
47 | |
47 |