Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
DineshArivu
Helper I
Helper I

Card values depends on slicer selection

Hi Experts,

 

I am using 2 slicers with min & max values and few cards to display the counts based on the selected slicer values as below :

DineshArivu_0-1755009923462.png

below the query which is executed from snowflake data source and the expected result is 490 , but i am getting 447 with all the filters applied in this query (using slicers in power bi report)

select * from datalake.dm_xxx.vw_opportunity_quote_source where sales_involvment='Sales Opportunities' and opportunity_stage='Closed Won' and closed_date between '2025-01-01'and'2025-06-30' and (amount_in_usd between '0' and '50000' or churn_in_usd between '-50000' and '0');

DineshArivu_1-1755010159875.png
here amount_in_usd and churn_in_usd  values are sample values , but user can select any values here.
this conditions should use in all the above cards in the first pic.

What i tried and no luck :

CALCULATE(DISTINCTCOUNT('Opportunity Quote Source'[SFDC_ENSONO_OPPORTUNITY]),
    KEEPFILTERS(
        'Opportunity Quote Source'[AMOUNT_IN_USD] IN VALUES('Opportunity Quote Source'[AMOUNT_IN_USD]) ||
        'Opportunity Quote Source'[CHURN_IN_USD] IN VALUES('Opportunity Quote Source'[CHURN_IN_USD])
    )
)


Please help to achieve this result

 

Thanks 

DK

1 ACCEPTED SOLUTION

@v-mdharahman thanks for the followup .. yes it was fixed.

I have used a reference table and used [AMOUNT_IN_USD] & [CHURN_IN_USD] slicer from there.

post that the data matches and all ok now.

 

thanks again for your response 🙂

View solution in original post

14 REPLIES 14
v-mdharahman
Community Support
Community Support

Hi ,Thanks for reaching out to the Microsoft fabric community forum.

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything that is unrelated to the issue or question. Also please show the expected outcome based on the sample data you provided.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community

 

I would also take a moment to thank @Greg_Deckler  and @Selva-Salimi, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference. 

If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

 

Best Regards,
Hammad.

Hi @DineshArivu,

As we haven’t heard back from you, so just following up to our previous message. I'd like to confirm if you've successfully resolved this issue or if you can provide some sample data so that we can further help you with your issue.

If yes, you are welcome to share your workaround so that other users can benefit as well.  And if you're still looking for guidance, feel free to give us an update, we’re here for you.

 

Best Regards,

Hammad.

Hi @DineshArivu,
Hope everything’s going smoothly on your end. As we haven’t heard back from you, so I wanted to check on you. Kindly share some sample data so that we can help you.
Still stuck? No worries just drop us a message and we can jump back in on the issue.

 

Best Regards,

Hammad.

@v-mdharahman thanks for the followup .. yes it was fixed.

I have used a reference table and used [AMOUNT_IN_USD] & [CHURN_IN_USD] slicer from there.

post that the data matches and all ok now.

 

thanks again for your response 🙂

Selva-Salimi
Super User
Super User

Hi @DineshArivu 

 

Did you have any Date table in your model which might have any relation with your main table?

@Selva-Salimi  No , here we are using a single table which has all the date related columns. here the issue is depends on the amount and churn slicers only .. without this slicer the values matches with snowflake but when we filter any values in the slicers then we got wrong counts in all cards.

It’s possible that the difference in the count of opportunities between Snowflake and Power BI is caused by blank or NULL values.
I recommend creating a table visual in Power BI showing opportunity ID, churn, amount, then export that table to Excel or ...

Do the same in Snowflake export the query results to Excel or ....
Once you have both datasets, Excel’s lookup functions to compare the two and identify where the differences occur.

 

If this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.

@Selva-Salimi  @Greg_Deckler 

Yes actually i found the issue that the following condition properly applied in snowflake - (amount_in_usd between '0' and '50000' OR churn_in_usd between '-50000' and '0') - OR logic.

But in Power BI , it is applied AND logic , here what i stuck .. attached the comparison below .
example : 3M company presence 4 rows in SF data (OR logic) but in DAX it is 3 rows (AND logic)
Snowflake data :

ACCOUNT_NAMESFDC_ENSONO_OPPORTUNITYKANTATA_OPPORUNITYEIM_OPPORTUNITYSP_OPPORTUNITYAGREEMENT_SIGNATURE_DATEOPPORTUNITY_NAMEOPPORTUNITY_STAGECLOSED_DATECHURN_IN_USDAMOUNT_IN_USDTYPE_OF_ORDERSALES_INVOLVMENTQUOTE_SOURCE
3M Company202412-64440    3M CP3000 study for z16 to migrated to DGClosed Won2/12/20250 NewSales OpportunitiesNo Quote
3M Company202412-64446    3M IBMi Hong Kong egress project and China project overage billingClosed Won2/6/20250587.25NewSales OpportunitiesNo Quote
3M Company202503-65670    3M Mainframe Application Latency Risk AssessmentClosed Won4/17/202506250NewSales OpportunitiesNo Quote
3M Company202506-66602006Qs00000RYqmRIAT 3M contract extension with commitment to digital servicesClosed Won6/26/20250108333.33NewSales OpportunitiesKANTATA Quote
Acacium Group202210-4845500607000004QKXXAA4202210-48455202210-48455Stage 4 Acacium Azure CSP migration Claranet to EnsonoClosed Won3/31/20250112650.4NewSales OpportunitiesEIM Quote


DAX data :

ACCOUNT_NAMESFDC_ENSONO_OPPORTUNITYKANTATA_OPPORUNITYEIM_OPPORTUNITYSP_OPPORTUNITYAGREEMENT_SIGNATURE_DATEOPPORTUNITY_NAMEOPPORTUNITY_STAGECLOSED_DATESum of AMOUNT_IN_USDSum of CHURN_IN_USDSALES_INVOLVMENTQUOTE_SOURCE
3M Company202412-64440   3M CP3000 study for z16 to migrated to DGClosed Won######## 0Sales OpportunitiesNo Quote
3M Company202412-64446   3M IBMi Hong Kong egress project and China project overage billingClosed Won########587.250Sales OpportunitiesNo Quote
3M Company202503-65670   3M Mainframe Application Latency Risk AssessmentClosed Won########62500Sales OpportunitiesNo Quote



@Selva-Salimi  @Greg_Deckler 

DineshArivu_0-1755072621687.png


Snowflake query : Output - 490 row count
select * from datalake.dm_bss_oss.vw_opportunity_quote_source where sales_involvment='Sales Opportunities' and opportunity_stage='Closed Won' and closed_date between '2025-01-01'and'2025-06-30' and (amount_in_usd between '0' and '50000' or churn_in_usd between '-50000' and '0');  -- values 0,50000 and all are just a sample in this query but we have a separate slicers for the amount seelction in dashboard

DineshArivu_1-1755073021521.png


DAX query : Output - 447 row count (should be 490)

CALCULATE (COUNT('Opportunity Quote Source'[SFDC_ENSONO_OPPORTUNITY]),
    FILTER (ALLSELECTED('Opportunity Quote Source'),
        (
            'Opportunity Quote Source'[AMOUNT_IN_USD] >= MIN('Opportunity Quote Source'[AMOUNT_IN_USD]) &&
            'Opportunity Quote Source'[AMOUNT_IN_USD] <= MAX('Opportunity Quote Source'[AMOUNT_IN_USD])
        )
        ||
        (
            'Opportunity Quote Source'[CHURN_IN_USD] >= MIN('Opportunity Quote Source'[CHURN_IN_USD]) &&
            'Opportunity Quote Source'[CHURN_IN_USD] <= MAX('Opportunity Quote Source'[CHURN_IN_USD])
        )))

 

@DineshArivu Again, have you tried it without the CALCULATE? See previous message.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@DineshArivu Nothing in your SQL statement is doing anything regarding DISTINCT. Try replacing your DISTINCTCOUNT with COUNTROWS and see if you get the 490.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler  No Luck . Still it is showing 447 .. 

Total Opportunity ID = CALCULATE(COUNTROWS('Opportunity Quote Source'),
    KEEPFILTERS(
        'Opportunity Quote Source'[AMOUNT_IN_USD] IN VALUES('Opportunity Quote Source'[AMOUNT_IN_USD]) ||
        'Opportunity Quote Source'[CHURN_IN_USD] IN VALUES('Opportunity Quote Source'[CHURN_IN_USD])
    )
)

We have to calculate a specific columns for this : Oppotunity ID 

@DineshArivu Probably something wonky with CALCULATE yet again, try a No CALCULATE approach:

No CALCULATE Measure =
  VAR __Table = FILTER( 'Opportunity Quote Source', [AMOUNT_IN_USD] IN DISTINCT('Opportunity Quote Source'[AMOUNT_IN_USD]) || [CHURN_IN_USD] IN DISTINCT( 'Opportunity Quote Source'[CHURN_IN_USD] )
  VAR __Result = COUNTROWS( __Table )
RETURN
  __Result

Honestly, I'm not sure why just COUNTROWS( 'Opportunity Quote Source' ) wouldn't work.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler  No luck, Still the count is not good 😞
here in the DAX just filtering and not calculating any column counts.
Column name : Opportunity ID

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.