Forum Discussion
COUNT SELECTED MONTHS WITH CONDITIONAL
Hello,
Anyone could please help me with this case?
I've trying a solution but I couldn't find a good author.
I've simplified the model:
Thanks!!
Hi riglesiassanz ,
I am not sure if I get what you mean. 🙂
Lets say the measure you use is your base measure. Can you try to put your base measure in my mesure in the following area?
In the end it should look like this or similar:
DISTINCT 1 EACH PERIOD = SUMX( VALUES(FactSampleTable[CODTDA]), var var_PeriodsInScope = DISTINCTCOUNT(DimDate[Year-Month]) var var_MonthsCovered = SUMX( VALUES(DimDate[Year-Month]), CALCULATE([Tiendas SC]) ) RETURN IF(var_PeriodsInScope=var_MonthsCovered,1,0) )The please put my Measure in the matrix.
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
7 Replies
- mangaus1111
Solution Sage
Hi riglesiassanz ,
can you show how is your imported table in power bi and how is written the measure [Medida Count]?
- riglesiassanzRegular Visitor
Hi mangaus1111 I think this could help. It is written in Spanish, but It the end is east to understand. I Hope!
-  
- Mikelytics
Resident Rockstar
Hi riglesiassanz ,
I recreated your example with the followiung dataset.
Fact Table:
Date Dimension Table with a year-Month Column:
Data Model:
Measure and Result:
Measure:
DISTINCT 1 EACH PERIOD = SUMX( VALUES(FactSampleTable[CODTDA]), var var_PeriodsInScope = DISTINCTCOUNT(DimDate[Year-Month]) var var_MonthsCovered = SUMX( VALUES(DimDate[Year-Month]), CALCULATE(DISTINCTCOUNT(FactSampleTable[CODTDA])) ) RETURN IF(var_PeriodsInScope=var_MonthsCovered,1,0) )Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
- Mikelytics
Resident Rockstar
riglesiassanz Awesome! 🙂 Thakn you for your feedback!
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!
@ me in replies or I'll lose your thread.