Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello everyone. I have this table
and I want to create something similar to this
The only way I could think of to do this is:
Measure =
var SelectedMonth = selectedvalue(T1[YearMonth])
var AllUserMonth= All users who bought in SelectedMonth , filtered by first_order = True
//Then:
Var Day01= All users who bought on day one (Daydate=1), filtered by SelectedMonth
Var Day02= All users who bought on day two (Daydate=2), filtered by SelectedMonth
Var Day03= All users who bought on day three, filtered by SelectedMonth
etc.... untill
Var Day31= All users who bought on day 31, filtered by SelectedMonth
//So, here at the end, make a Count of "how many Day01 users there are in AllUserMonth"; "how many Day02 users there are in AllUserMonth"..... etc untill Day31.
So, I need a way to calculate "how many values of one variable are in this other variable". I tried several ways with addcolumns but no success.
I know this is inefficient, that if the SelectMonth doesn't work I'll have to create a variable for each month and then day variables for each month... but I have no problem writing all that (And it's the only way I could think of that could replicate the Excel table in PBI 😣)
Any help is welcome, thanks 🙂
You can get the required date like this:
VAR _CUR_DATE = MAX('T1'[ORDER_DATE])
VAR _DATE_MIN = DATE(YEAR(_CUR_DATE),MONTH(_CUR_DATE),DAY(_CUR_DATE))
VAR _DATE_MAX = DATE(YEAR(_CUR_DATE),MONTH(_CUR_DATE),DAY(_CUR_DATE))+1
Please feel free to let me know if I misunderstood your needs. It would be helpful if you could attach the measure you created for each day below.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
58 | |
55 | |
54 | |
38 | |
29 |
User | Count |
---|---|
78 | |
62 | |
45 | |
40 | |
40 |