Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi experts!
I have a sales table linked to a calendar table.
This values are displayed in a matrix in this format:
2023-Jan | 2023-Feb | 2023-Mar | ... | ... | ... | ... | ... | ... | ... |
500 | 600 | 500 | 700 | 600 | 700 | 800 | 900 | 450 |
200 |
Then I have a second calendar table that represents specific cycles:
Date | Cycle |
01.01.2023 | A |
.... | .... |
01.12.2023 | L |
This table represents the last date that should be considered to be accounted for the matrix above.
If I select Cycle A, then I want to see all sales before that day. If it is "L" etc.
In the end I want something like this:
Cycle | 2023-Jan | 2023-Feb | 2023-Mar | ... | ... | ... | ... | ... | ... | ... |
A | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 |
B | 500 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 |
C | 500 | 600 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 |
How would you do that?
Hi @joshua1990
Assuming 'Cycle' table is a disconnected table, please try
Cycle Sales =
CALCULATE (
[Sales Amount],
KEEPFILTERS ( 'Date'[Date] <= MAX ( Cycle[Date] ) )
)
Hi, this is not working. This is the result:
Cycle | 2023-Jan | 2023-Feb | 2023-Mar | ... | ... | ... | ... | ... | ... | ... |
A | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 |
B | 500 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 |
C | 0 | 600 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 |
As you can see for cycle "C" I get 0 for 2023-Jan. But there should be a value of 500
Still the same issue
Let's take C as an example. Here the date is 01.03.2023.
So in the matrix I would get an value for 2023-Jan and 2023-Feb since both months are before the selected C cycle.
@tamerj1 : Now I tested you approach in a new PBI File and I get this failure:
cannot display the data because power bi can't determine the relationship between two or more fields
Yes, I just have a relation between Date and Sales table. Cycle Table has no relationship to the other tables
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
17 | |
10 | |
10 | |
8 | |
6 |
User | Count |
---|---|
18 | |
16 | |
15 | |
12 | |
10 |