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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
nsatyabrat7
Helper I
Helper I

dax 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

2 REPLIES 2
nsatyabrat7
Helper I
Helper I

hi amit,

 

   it would be difficult for me to share the data..the question here is not on the data on the data model or dax query pattern...pls  let me know any dax pattern you want me to follow to write this query..

amitchandak
Super User
Super User

@nsatyabrat7 , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.