Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello All,
Im trying to get an output of 0 or 1 for flag using a calculated column, code:
Solved! Go to Solution.
Hi @Anonymous
Please try this Calculated column.
CI_c =
IF (
CALCULATE (
COUNT ( CI[PPLCODE] ),
FILTER (
CI,
CI[PPLCODE] = 'IRR Retina'[PPL CD]
&& CI[UPDATED_ON_DT].[Date] > 'IRR Retina'[Contract Start Date_c]
&& CI[UPDATED_ON_DT].[Date] <= 'IRR Retina'[Transaction date_c]
)
) > 0,
1,
0
)
Then, the result should look like this.
Attached the pbix file as reference. If it doesn’t work, could you please provide some sample data used by this formula and let me know the relationship between your tables? Thanks in advance!
In addition, you can use Performance Analyzer to help you optimize your calculation. For more details about Performance Analyzer, please refer to Use Performance Analyzer to examine report element performance.
Best Regards,
Community Support Team _ Caiyun
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi @Anonymous
Please try this Calculated column.
CI_c =
IF (
CALCULATE (
COUNT ( CI[PPLCODE] ),
FILTER (
CI,
CI[PPLCODE] = 'IRR Retina'[PPL CD]
&& CI[UPDATED_ON_DT].[Date] > 'IRR Retina'[Contract Start Date_c]
&& CI[UPDATED_ON_DT].[Date] <= 'IRR Retina'[Transaction date_c]
)
) > 0,
1,
0
)
Then, the result should look like this.
Attached the pbix file as reference. If it doesn’t work, could you please provide some sample data used by this formula and let me know the relationship between your tables? Thanks in advance!
In addition, you can use Performance Analyzer to help you optimize your calculation. For more details about Performance Analyzer, please refer to Use Performance Analyzer to examine report element performance.
Best Regards,
Community Support Team _ Caiyun
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi @Anonymous
Can you post sample data as text and expected output?
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.
4. Relation between your tables
Appreciate your Kudos!!
LinkedIn:www.linkedin.com/in/vahid-dm/
New Year Power BI eCard:
https://community.powerbi.com/t5/Data-Stories-Gallery/Happy-New-Year/td-p/2266398
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
23 | |
10 | |
10 | |
9 | |
7 |