The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi there ;
İ would like to calculate below issue could you pls help me , let me explain pls sceneraio first :
i have a table as below which one you can see at left below ; i would like to calculate the rate " Customer Qty "of report for last day on report .
Customer Qty (counted ) on status "Actual Monh " total and between "Actual Month + Next Month " Total ,
i tried to explain below picture what i need , i hope it is clear , thanks in advance for your kind supports
Solved! Go to Solution.
Hello @erhan_79
Give this a try.
Rate =
VAR _Date = MAX ( YourTable[Report Date] )
VAR _Act = CALCULATE ( COUNTROWS(YourTable), YourTable[Report Date] = _Date, YourTable[Status] = "Actual Month" )
VAR _ActNext = CALCULATE ( COUNTROWS(YourTable), YourTable[Report Date] = _Date )
RETURN
DIVIDE ( _Act, _ActNext )
Please try this expression in a measure:
NewMeasure =
VAR __maxdate =
MAX ( Table[Report Date] )
VAR __maxdatetable =
FILTER ( Table, Table[Report Date] = __maxdate )
VAR __actualmonthcount =
COUNTROWS ( FILTER ( __maxdatetable, Table[Status] = "Actual Month" ) )
VAR __nextmonthcount =
COUNTROWS ( FILTER ( __maxdatetable, Table[Status] = "Next Month" ) )
RETURN
DIVIDE ( __actualmonthcount, __actualmonthcount + __nextmonthcount )
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hello @erhan_79
Give this a try.
Rate =
VAR _Date = MAX ( YourTable[Report Date] )
VAR _Act = CALCULATE ( COUNTROWS(YourTable), YourTable[Report Date] = _Date, YourTable[Status] = "Actual Month" )
VAR _ActNext = CALCULATE ( COUNTROWS(YourTable), YourTable[Report Date] = _Date )
RETURN
DIVIDE ( _Act, _ActNext )