Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
bdeleur
Helper III
Helper III

Calculations in history

Hi everybody,

 

In a database I do a calculation for now to see if the date is overdue. Realtime works perfectly but I'm wondering if I can recreated the same outcome but in history.  If I selectef 1-1-2023 I want the calculation of that day etc etc.

 

The rule in Powerquery is now:

#"OLL?" = Table.AddColumn(#"Aangepaste kolom toegevoegd13", "OLL?", each if [RealizedDischargeDate] = null and [Inititialdischargedate_aanpassing_WLZ] < Date.From(DateTime.LocalNow()) and ([DischargeProposedStartDate]= null or [DischargeProposedStartDate] > Date.From(DateTime.LocalNow())) then "OLL" else null),

 

I hope somebody can help me.

 

Greetings

9 REPLIES 9
lbendlin
Super User
Super User

Please provide a more detailed explanation of what you are aiming to achieve. What have you tried and where are you stuck?

Hi,

 

now I make an excel file every time the dashboard updates. I don't have any clue how to make the same logic work for an archive.

Power BI has no memory* . You need to manage your snapshots in the upstream system. * Yes, there is the self referencing option but that has no safety net.

 

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

I'm struggling to create the database for here. Hopefully the tables below will help.

The intention is to check for each day whether a row (ID) falls between a start date and an end date. The intention is that only the COUNT is reported. The other columns are for the example.

 

 IDIDIDCOUNT
 123 
1-1-2023X  1
2-1-2023XX 2
3-1-2023XX 2
4-1-2023 X 1
5-1-2023 X 1
6-1-2023 XX2
7-1-2023  X1
8-1-2023  X1

 

IDstartdateenddate
130-12-20223-1-2023
22-1-20236-1-2023
36-1-2023 

see attached

Your solution indeed works perfectly on the sample data but somehow not on my real dataset. That's why I have a bit more extensive set and outcome here that I can share with you. Hopefully you see what happened.

The screeshot is the result of your code:

bdeleur_0-1692260611673.png

 

Expected outcome 

Data 

see attached

Hi, thanks for the new file. That actually worked for me too. What went wrong for me is that I used my date table and not a separate column with the date. Now it fits better, but that also makes me discover that it will never work since the data is always adjusted to what I want to see. The status of the IDs change, but that is not recorded in a database, the data is always overwritten.

 

Thank you for your help, it was certainly correct and fast.
Thanks, I'll mark your answer as resolved.

Hi @lbendlin,

 

Sorry I was on holiday. I'll make a sample dataset and post it here. To be continued. Tnx for the help.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.