Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Requirement: -
I have to create a checkbox filter, to display the Client's data(SourceName field) when there is an Order Id (i.e. a transaction) for Q12020 (i.e. Jan-2020, Feb-2020, Mar-2020) from the Transaction table. So I am trying to return either
1) True/False whenever there is an order_id for those transaction months or
2) SourceName for those transaction months.
ClientKey is the column on which both the tables (Transaction and Client) are related as Many to one.
This is what I have tried in a calculated column:
But, it does not give correct results, like Flag should be False for Jan-2018 and so on and True only for Jan-2020, Feb-2020, Mar-2020.
I also tried doing this in a different way ,
by displaying all Clients Name (SourceName from Client Table) for the filter Q12020:
Result:
It is not filtering properly, it displays data for all TransactionYearMonth for few clients even when the Filter condition(Q12020) is not satisfied.
Not sure what am I missing here?
Solved! Go to Solution.
@Anonymous , Try like
Flag =
var countorderid = COUNTX(FILTER(RELATEDTABLE('olap fact_Transaction'),'olap fact_Transaction'[TransactionYearMonth] in{ "Jan-20" , "Feb-20","Mar-20"}),[order_id])+0
RETURN
IF(countorderid>0,"True","False")
If not
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
@Anonymous , Try like
Flag =
var countorderid = COUNTX(FILTER(RELATEDTABLE('olap fact_Transaction'),'olap fact_Transaction'[TransactionYearMonth] in{ "Jan-20" , "Feb-20","Mar-20"}),[order_id])+0
RETURN
IF(countorderid>0,"True","False")
If not
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Hi @amitchandak ,
I have tried your way, it still does not show the correct results:
I will send you sample data as well.
@Anonymous , Try new column
if([DateSort] in {202001, 202002,202003} , 1, 0)
or
if([DateSort] in {"202001", "202002","202003"} , 1, 0)
Hi @amitchandak ,
I tried doing it and the results are as below:
The catch is this won't work in my scenario, because now If I put a filter/Slicer on this column, it will show me data for just these three months, but I want to display data for all Transaction Months but for only those Clients who have transactions in at least Jan-20, Feb-20, Mar-20 months.
For this reason, I am trying to take a count of Order ID for Q12020 and then display True/False.
The above-mentioned issue has been resolved by creating this calculated column:
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
97 | |
78 | |
64 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |