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.
I have a dataset A with the following columns:
Objective:
01/01/2024 | A | Y | M |
02/01/2024 | B | Y | M |
03/01/2024 | C | X | M |
04/01/2024 | A | X | M |
05/01/2024 | B | X | N |
06/01/2024 | C | X | N |
07/01/2024 | A | Y | N |
08/01/2024 | B | Y | N |
Y | M | 02/01/2024 | B |
X | M | 04/01/2024 | A |
X | N | 06/01/2024 | C |
Y | N | 08/01/2024 | B |
A | 1 |
B | 2 |
C | 1 |
Y | M | 02/01/2024 | B |
X | M | 04/01/2024 | A |
X | N | 06/01/2024 | C |
Y | N | 07/01/2024 | A |
A | 2 |
B | 1 |
C | 1 |
How can I implement this in Power BI? Specifically, I need help with:
Any suggestions or DAX solutions would be greatly appreciated!
Solved! Go to Solution.
hi
1) Use the following DAX formula to create a calculated table:
IntermediateTable =
SUMMARIZE(
FILTER(
'Dataset A',
'Dataset A'[Date] IN VALUES('DateTable'[Date])
),
'Dataset A'[Type],
'Dataset A'[Group],
"Max_Date_By_Type_Group", MAX('Dataset A'[Date]),
"Product_Code",
FIRSTNONBLANK(
FILTER(
'Dataset A',
'Dataset A'[Date] = MAX('Dataset A'[Date])
),
'Dataset A'[Product_Code]
)
)
2) Use this DAX measure to calculate the count of days matching Max_Date_By_Type_Group:
Amount_Date =
CALCULATE(
COUNTROWS('Dataset A'),
'Dataset A'[Date] IN DISTINCT(IntermediateTable[Max_Date_By_Type_Group]),
'Dataset A'[Product_Code] IN DISTINCT(IntermediateTable[Product_Code])
)
This ensures the correct Product_Code and Amount_Date based on the slicer selection.
hi
1) Use the following DAX formula to create a calculated table:
IntermediateTable =
SUMMARIZE(
FILTER(
'Dataset A',
'Dataset A'[Date] IN VALUES('DateTable'[Date])
),
'Dataset A'[Type],
'Dataset A'[Group],
"Max_Date_By_Type_Group", MAX('Dataset A'[Date]),
"Product_Code",
FIRSTNONBLANK(
FILTER(
'Dataset A',
'Dataset A'[Date] = MAX('Dataset A'[Date])
),
'Dataset A'[Product_Code]
)
)
2) Use this DAX measure to calculate the count of days matching Max_Date_By_Type_Group:
Amount_Date =
CALCULATE(
COUNTROWS('Dataset A'),
'Dataset A'[Date] IN DISTINCT(IntermediateTable[Max_Date_By_Type_Group]),
'Dataset A'[Product_Code] IN DISTINCT(IntermediateTable[Product_Code])
)
This ensures the correct Product_Code and Amount_Date based on the slicer selection.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
32 | |
27 | |
24 | |
20 | |
16 |
User | Count |
---|---|
54 | |
38 | |
26 | |
24 | |
20 |