Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Solved! Go to Solution.
Hi,
This should do the trick:
_CasesInPeak =
SUMX(
SUMMARIZE(tblPeak,[_Month],[_Day],[_Hour], "c", COUNTROWS(tblPeak)) ,
IF([c] > 200,[c],BLANK())
)
_Month = MONTH('tblPeak'[open_time])
_Day = DAY('tblPeak'[open_time])
_Hour = HOUR('tblPeak'[open_time])
_TotalCasesMinusCasesInPeak = COUNTROWS(tblPeak) - [_CasesInPeak]
As seen here (days as rows, hours in columns):
Testdata generated with:
tblPeak =
var _tbl =
SELECTCOLUMNS(
CROSSJOIN(
ROW("test", DATE(2020, 10,3)),
GENERATESERIES(1,28,1)
), "StartDate", [test], "Increment", [Value])
var _dates =
ADDCOLUMNS( _tbl, "NewDate", [StartDate]+[Increment])
return
SELECTCOLUMNS(
ADDCOLUMNS(
CROSSJOIN(
_dates, GENERATESERIES(1,1100,1)), "open_time", [NewDate] + NORM.INV(RAND(), 0.5 + ([Increment]/100), 0.08), "incident_ref", CONVERT( UNICHAR(RANDBETWEEN(65,90)),STRING) & CONVERT( UNICHAR(RANDBETWEEN(65,90)),STRING) & CONVERT( UNICHAR(RANDBETWEEN(65,90)),STRING)
), "open_time", [open_time], "incident_ref", [incident_ref]
)
Link to file.
Please mark as solution if so. Thumbs up for the effort are appreciated.
Kind regards,
Steve.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Hi,
This should do the trick:
_CasesInPeak =
SUMX(
SUMMARIZE(tblPeak,[_Month],[_Day],[_Hour], "c", COUNTROWS(tblPeak)) ,
IF([c] > 200,[c],BLANK())
)
_Month = MONTH('tblPeak'[open_time])
_Day = DAY('tblPeak'[open_time])
_Hour = HOUR('tblPeak'[open_time])
_TotalCasesMinusCasesInPeak = COUNTROWS(tblPeak) - [_CasesInPeak]
As seen here (days as rows, hours in columns):
Testdata generated with:
tblPeak =
var _tbl =
SELECTCOLUMNS(
CROSSJOIN(
ROW("test", DATE(2020, 10,3)),
GENERATESERIES(1,28,1)
), "StartDate", [test], "Increment", [Value])
var _dates =
ADDCOLUMNS( _tbl, "NewDate", [StartDate]+[Increment])
return
SELECTCOLUMNS(
ADDCOLUMNS(
CROSSJOIN(
_dates, GENERATESERIES(1,1100,1)), "open_time", [NewDate] + NORM.INV(RAND(), 0.5 + ([Increment]/100), 0.08), "incident_ref", CONVERT( UNICHAR(RANDBETWEEN(65,90)),STRING) & CONVERT( UNICHAR(RANDBETWEEN(65,90)),STRING) & CONVERT( UNICHAR(RANDBETWEEN(65,90)),STRING)
), "open_time", [open_time], "incident_ref", [incident_ref]
)
Link to file.
Please mark as solution if so. Thumbs up for the effort are appreciated.
Kind regards,
Steve.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Many thanks !
It works perfectly, and the dashboard is wonderfull.
Thanks again for your reactivity and help
Benjamin
Thanks 🙂
Glad to be of help!
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
hi,
Thank you very much for your answers and I'm sorry if it's not really clear.
I will try the solution at work tomorrow and keep you up to date.
Benjamin
Hi,
Welcome. Will await your response tomorrow. Pls tag me in your response.
Have a nice Sunday. Kind regards, Steve
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |