Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I am new to power bi and am experiencing some trouble which I can't seem to solve with Google's help.
I have a dataset where each line is a notification made together with the date the notification is made.
There are days where no notification is made. I want to visualise for the last 7 days how many notifications were made per day. For that I have added a column with the value 1 if the notification is made in the last 7 days and the value 0 if it is older. But the dates that don't have a notification are not shown.
Day | Notification | Last 7 days |
18/1/2022 | dddd | 1 |
17/1/2022 | cccc | 1 |
16/1/2022 | bbbb | 1 |
10/1/2022 | aaaa | 0 |
What I get when I try to visualize:
What I want:
Anyone knows how to deal with this?
Solved! Go to Solution.
Hi @MDLO,
Did you mean to create a calculated column to remark the last 7 days based on the current system date? If that is the case, you can refer to the following expressions:
Is Last 7 day =
IF ( 'Table'[Date] IN GENERATESERIES ( TODAY () - 6, TODAY () ), 1, 0 )
BTW, you can't achieve the effect as second graph. Power bi will auto-hide the data label which has zero values. Perhaps you can use some default values instead of zero to keep the axis date range displayed.
Regards,
Xiaoxin Sheng
Hi @MDLO,
Did you mean to create a calculated column to remark the last 7 days based on the current system date? If that is the case, you can refer to the following expressions:
Is Last 7 day =
IF ( 'Table'[Date] IN GENERATESERIES ( TODAY () - 6, TODAY () ), 1, 0 )
BTW, you can't achieve the effect as second graph. Power bi will auto-hide the data label which has zero values. Perhaps you can use some default values instead of zero to keep the axis date range displayed.
Regards,
Xiaoxin Sheng
@MDLO you need add a date dimension in your model and use that on x-axis, to add one, you can follow my blog post here Create a basic Date table in your data model for Time Intelligence calculations | PeryTUS IT Solutio...
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k thanks for the quick reply. I managed to set the Date table up until the last step: the relationships.
In my table (notifications list) I have 2 dates: "Datum_melding" (= this is de date of the notification) and "Flow_completedb" (= when notification was closed).
First issue:
When linking "Date' to "Flow_completedb" I get no issues/errors
When trying to connect "Date" to "Datum_melding" I get the following error:
Second issue:
When I try to visualise with the date 'Flow_completedb" (which is already linked), I still get the same result.
Any ideas on how to solve?
User | Count |
---|---|
103 | |
87 | |
77 | |
70 | |
69 |
User | Count |
---|---|
113 | |
99 | |
97 | |
72 | |
68 |