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 current have this table that I am working with.
I want to write a DAX function to display the table below where the following rules is applied
1. Show name of account opened in the 2020 to 2022 and where subscription year is 2022
2. Don't show name of account that subscription year is not 2022
3. Show name of account open in 2022 and subscription year is blank.
4. Don't show account open before 2022 and subscription year is blank
Solved! Go to Solution.
Hi @alexumagba ,
Here are the steps you can follow:
1. Create measure.
Flag =
SWITCH(
TRUE(),
YEAR(MAX('Table'[Year opened])) >=2022&&MAX('Table'[subscription year])=BLANK(),1,
YEAR(MAX('Table'[Year opened])) >=2020&&
YEAR(MAX('Table'[Year opened]))<=2022 &&
YEAR(MAX('Table'[subscription year]))=2022,1,
YEAR(MAX('Table'[subscription year]))=2022,1,0)
2. Place [Flag]in Filters, set is=1, apply filter.
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @alexumagba ,
Here are the steps you can follow:
1. Create measure.
Flag =
SWITCH(
TRUE(),
YEAR(MAX('Table'[Year opened])) >=2022&&MAX('Table'[subscription year])=BLANK(),1,
YEAR(MAX('Table'[Year opened])) >=2020&&
YEAR(MAX('Table'[Year opened]))<=2022 &&
YEAR(MAX('Table'[subscription year]))=2022,1,
YEAR(MAX('Table'[subscription year]))=2022,1,0)
2. Place [Flag]in Filters, set is=1, apply filter.
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thanks. This works perfectly well
I would try Summarize and Filter for the conditions you have listed
Hi @alexumagba ,
Is there a reason why you want to do this in DAX instead of using filters on the table?
Please disregard the filter. This is suppose to be a daily automated task. I want to avoid using the filter everyday
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
202 | |
137 | |
106 | |
70 | |
68 |