The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello
I have got a table that contains contract expiry dates. Would like to create a new column that identifies contracts as
My final output is creating a matrix table that counts the number of contracts falling in the four categories above.
Can anyone help with the steps to get this output?
Hi,
Please check the below picture and the attached pbix file.
Contracts count: =
CALCULATE (
COUNTROWS ( VALUES ( Data[Contract] ) ),
FILTER (
Data,
CALCULATE (
COUNTROWS ( Category ),
FILTER (
Category,
Data[Expiry date] - TODAY () >= Category[Min period]
&& Data[Expiry date] - TODAY () <= Category[Max period]
)
) > 0
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
pls try this
category =
VAR gap='Table'[expiry date]-TODAY()
return SWITCH(TRUE(),gap<0,"expired",gap<=90,"Expiring in 90 Days",gap<=180,"Expiring in 180 Days","Expiring 180 days +")
Proud to be a Super User!
Hi Ryan,
Tried the formula but it throws up errors, am I entering it correctly?
try to use DAX to create a column, not in the PQ editor.
Proud to be a Super User!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
93 | |
81 | |
63 | |
56 |
User | Count |
---|---|
248 | |
124 | |
111 | |
78 | |
78 |