Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi ,
I need help in figuring out the solution for a measure in Analysis Tabular Cube. CountProduct is the measure I am trying to create. I need to find count of products based on the below criteria ( scenarions listed in the table below) and the count should be visible at any grain when sliced. Also Grand Total should be just the total count of products for any given selection
Scenario | NetSupply[Existing measure : Supply- Demand ] | CountProduct |
No Demand No Supply | 0 | Blank |
Product With Supply and no Demand or 0 Zero Demand | > 0 | Blank |
Product With no Supply and has Demand | < 0 | 0 |
Product with Supply and Demand | 0 | 1 |
Product with Supply and Demand | <0 | 0 |
Product with Supply and Demand | >0 | 1 |
Demand, Supply & Net Supply are existing measures in Cube. if a product is has 2 segment ID's and has demand and supply , I need to double count when looking at the higher grain which is why i used Summarize function to group by productid and segmentid. Below measure is showing just 0 even when demand and supply are available.
CountProduct:=
VAR RowCount =COUNTROWS (
FILTER (
SUMMARIZE(FILTER('SupplyTable',[Demand]>0 && [Supply]>0), 'SupplyTable'[ProductID] ,'SupplyTable'[SegmentID]),
(
IF(
(
(ISBLANK([Demand])=TRUE
||[Demand]=0
)
&&
(ISBLANK([Supply])=TRUE
||[Supply]=0)
)
||
(
(ISBLANK([Demand])=TRUE
||[Demand]=0)
&&
[Supply]>0
)
,-1
,
IF
(
(ISBLANK([Demand])=FALSE
||[Demand]>0
)
&&
(ISBLANK([Supply])=TRUE
||[Supply]=0)
,[Demand]
,[Net Supply]
)
)>= 0
))
)
RETURN
IF (ISBLANK(RowCount)=TRUE &&[Net Supply]<0,0,RowCount)
I got solutions from @amitchandak and @Greg_Deckler before. Hope you can help even this time or even anyone in this forum
Hi @gardas_swathi ,
Have trouble to follow, please share some sample data so that we could test formula.
Best Regards,
Jay
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
26 | |
21 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |