Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi.
I would like help with an application in PBI Desktop. I don't know how to start...
I have to create a simple line chart to compare an "Energy measure" (fMP table) with a "Weight/Time measure" (fMPPr table), however the granularity of the "fMP table" is each 15 minutes and the data in the "fMPPr table" is per event, that is, each row has a time interval of hours&minutes.
I need to compare two measurements at the same time base (15 minutes granularity), so I first have to divide each row into several rows of minute granularity and then group the data by 15 minutes (same granularity as the fMP table). I created a drawing demonstrating my need and also the .pbix application link .PBIX.
If anyone can help in how to do it I thank you immensely. I have no idea how to start ...
Greetings !
Solved! Go to Solution.
Hi @aBerg
You can create a new calculated table as follows. It's a long piece of code. I'm sure it can be done in a shorter fashion but I ain't yet had time to trim it down. The columns of interest are [Expanded Date/Time] and [Weight/Time per 15 mins]. You can further manipulate the resulting table to select only specific columns or change their name if required.
NewTable2 = FILTER ( VAR _OneMinute = 1 / 24 / 60 VAR _ExpandedTable = GENERATE ( fMPPr; VAR _CurrentTime = fMPPr[Date&Time] VAR _NextTimeAux = CALCULATE ( MIN ( fMPPr[Date&Time] ); ALL ( fMPPr ); fMPPr[Date&Time] > EARLIER ( fMPPr[Date&Time] ) ) VAR _NextTime = IF ( NOT ISBLANK ( _NextTimeAux ); _NextTimeAux; _CurrentTime ) //The IF is to avoid expansion in the very last Date/Time VAR _ResultTable = SELECTCOLUMNS ( GENERATESERIES ( _CurrentTime; _NextTime; _OneMinute ); "Expanded Date/Time"; [Value]; "Expanded Weight/Time"; [Weight/Time] ) RETURN _ResultTable ) RETURN ADDCOLUMNS ( _ExpandedTable; "Weight/Time per 15 mins"; IF ( MINUTE ( [Expanded Date/Time] ) IN { 0; 15; 30; 45 }; SUMX ( FILTER ( _ExpandedTable; DATEDIFF ( [Expanded Date/Time]; EARLIER ( [Expanded Date/Time] ); MINUTE ) >= 1 && DATEDIFF ( [Expanded Date/Time]; EARLIER ( [Expanded Date/Time] ); MINUTE ) <= 15 ); [Expanded Weight/Time] ) ) ); NOT ISBLANK ( [Weight/Time per 15 mins] ) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
96 | |
79 | |
65 | |
62 |
User | Count |
---|---|
147 | |
116 | |
104 | |
88 | |
65 |