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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
sajjadsaj
New Member

i want to reduce this formula forward to simple please help me out

t3 = var t2 = DIVIDE(sum(Orders[Sales]),CALCULATE(sum(Orders[Sales]),all('date'[day])))
var t1 = DIVIDE(sum(Orders[Sales]),CALCULATE(sum(Orders[Sales]),all('date'[Date (bins)])))

return IF(SELECTEDVALUE('date'[day]),t2,t1)
sajjadsaj_0-1708620779716.png

i want t3 as output

2 REPLIES 2
sajjadsaj
New Member

Hi @amitchandak sir,

 

both are taking more time then early one i want to reduce according to utilization time. cannot we play with date table ?

amitchandak
Super User
Super User

@sajjadsaj , Try like

 

t3 =
VAR TotalSales = SUM(Orders[Sales])
VAR SalesByDay = CALCULATE(TotalSales, ALL('date'[day]))
VAR SalesByDateBins = CALCULATE(TotalSales, ALL('date'[Date (bins)]))
RETURN IF(SELECTEDVALUE('date'[day]), DIVIDE(TotalSales, SalesByDay), DIVIDE(TotalSales, SalesByDateBins))

 

 

or

 

 

t3 =
VAR TotalSales = SUM(Orders[Sales])
VAR SalesByDay = CALCULATE(TotalSales, ALL('date'[day]))
VAR SalesByDateBins = CALCULATE(TotalSales, ALL('date'[Date (bins)]))
RETURN IF(isinscope('date'[day]), DIVIDE(TotalSales, SalesByDay), DIVIDE(TotalSales, SalesByDateBins))

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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