March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have a date table with many columns for different areas surrounding date and times. I have a quarter column to show if each row belongs in Q1, 2, 3, or 4. I have a Reporting Month, Reporting Quarter, and Reporting Year column that tells me if the current row is the current reporting month, quarter, and year. These 3 columns are type logical in Power Query.
I have a certain ask from one of my clients for a report that if the current reporting quarter is Q1. Then show Q4 of last year and Q1 of this year's data so they can see a trend leading into the new year. If the current reporting quarter is not Q1 ie Q2, 3, or 4, then only show this current year's data.
I have tried multiple work arounds in Power Query to create a column to facilitate this so I can use this column as a page level filter.
The main issue is that I cannot say when quarter = 1 and quarter = 4. It has to be 1 or 4 but to show Q4, it is dependent on Q1. If anyone has any suggestions on Power Query code for this would be greatly appreciated, thanks.
Date | Year | Quarter | Completed Month | Completed Year | Completed Quarter | Reporting Month | Reporting Quarter | Reporting Year |
28/12/2023 | 2023 | Q4 | TRUE | TRUE | TRUE | FALSE | FALSE | FALSE |
29/12/2023 | 2023 | Q4 | TRUE | TRUE | TRUE | FALSE | FALSE | FALSE |
30/12/2023 | 2023 | Q4 | TRUE | TRUE | TRUE | FALSE | FALSE | FALSE |
31/12/2023 | 2023 | Q4 | TRUE | TRUE | TRUE | FALSE | FALSE | FALSE |
1/1/2024 | 2024 | Q1 | FALSE | FALSE | FALSE | TRUE | TRUE | TRUE |
2/1/2024 | 2024 | Q1 | FALSE | FALSE | FALSE | TRUE | TRUE | TRUE |
3/1/2024 | 2024 | Q1 | FALSE | FALSE | FALSE | TRUE | TRUE | TRUE |
The table has a lot more columns than this, but these are the 9 columns that would be used for this logic I am trying to build.
Essentially I want if the reporting quarter = true and quarter = Q1 then show Q1 and show Q4 where Year = Reporting Year - 1 (I have seperate logic working for this as an intermediate step rather than as a column itself). Else show data only where Reporting Year = True and Completed Month = True.
Data from this table ranges back to 2021
I hope this clarifies the data structure
@Anonymous OK, so then this table is linked to a fact table that has values of something in it? Or are those values in that table as well? Makes a difference in terms of the actual solution.
This table links to multiple fact tables with a date column in each table. The table has a relationship from the Date column in the table above to all of the other datasets.
@Anonymous Perhaps just create a Q4 DAX measure that only displays if the quarter is Q1 or Q4. Also have your other measure for display Q1, Q2 and Q3 only. Then put both in whatever visual.
Otherwise, sample data would help tremendously. Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
90 | |
89 | |
85 | |
73 | |
49 |
User | Count |
---|---|
169 | |
144 | |
90 | |
70 | |
58 |