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! Request now

Reply
nsatyabrat7
Helper I
Helper I

dax measure help

hi,

 

   in my database i have some calculations are getting done on a view which is basically created on the grouping of a table..

 view def-  create view xyz as select a, b , c, d, e FROM table_data where date between '2020-10-31' and '2020-11-05'
                     group by a, b , c, d, e

Calculation - SUM(IF(c="delivered" AND date_diff(d ,e ,day)<4 AND date_diff(CURRENT_DATE(),e>3,1,0))  

                        result- 1500 

 

  but in my cube i have the same table (table_data) ..when i am trying to use same calculation here i am getting a different result...

Calculation - IF(table_data[c]="delivered" && DATEDIFF(table_date[e].[Date],table_data[d].[Date],DAY)<4 && DATEDIFF(table_data[e].[Date],TODAY(),DAY)>3 ,1,0)

                        result- 6300 

 

  Please need help to write this dax query.....only difference is database calculation is done on top of a view(where data is grouped) where cube is done a table

1 REPLY 1
lbendlin
Super User
Super User

Sounds like the granularity level is different between your cube dimensions and your view groups.  You did not specify which of the results you consider to be "correcter". Please provide sample data in usable format and show expected outcome.

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.